Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6502

How do I print my IP address in a system call (Ubuntu 20.04 LTS)?

$
0
0

I'm learning to add system calls to the kernel. Ubuntu 20.04 LTS is my system.

So far, I understood how to print "Hello", but I'd also like to print my IP address. How is this done? Do I have to do this in C? If so, how? Do I have to use a Bash command like hostname -I? If so, how?

So far, this is the C file I'm working with.

#include<linux/kernel.h>asmlinkage long sys_identity(void){printk("Hello. My name is Mind Y. Business.\m");return 0;}

Viewing all articles
Browse latest Browse all 6502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>