Trying to look at sources for common unix/linux commands
I was wondering if there is somewhere where i can look at the source for some basic commands in unix/linux like ls and who.
I'm an aspiring programmer and I'm just curious to see the code. |
http://lxr.linux.no/
is the best one to have look @ code I am not able to compile c code gcc is not getting path of module.h and kernel.h #include <module.h> /* Needed by all modules */ #include <kernel.h> /* Needed for KERN_INFO */ int init_module(void) { printk(KERN_INFO "Hello world 1.\n"); /* * A non 0 return means init_module failed; module can't be loaded. */ return 0; } void cleanup_module(void) { printk(KERN_INFO "Goodbye world 1.\n"); } ========================= [root@linuxguru.symantec.com][ /usr/src ]gcc -o hello-1.0 hello-1.c hello-1.c:1:54: error: module.h: No such file or directory hello-1.c:2:53: error: kernel.h: No such file or directory hello-1.c: In function ‘init_module’: hello-1.c:6: error: ‘KERN_INFO’ undeclared (first use in this function) hello-1.c:6: error: (Each undeclared identifier is reported only once hello-1.c:6: error: for each function it appears in.) hello-1.c:6: error: expected ‘)’ before string constant hello-1.c: In function ‘cleanup_module’: hello-1.c:14: error: ‘KERN_INFO’ undeclared (first use in this function) hello-1.c:14: error: expected ‘)’ before string constant [root@linuxguru.symantec.com][ /usr/src ]vi hello-1.c = plz compile @ ur end and let me know ? |
Quote:
also, for a lot of Open-source SW, there are typically project pages at sourceforge. |
All times are GMT -5. The time now is 06:46 PM. |