Results 1 to 5 of 5
Hello,
I got quite an easy question I guess.
Does unistd.h declare functions in the kernel or in the stdclib? Or in any other C file.
I need to know ...
- 04-20-2010 #1
unistd.h
Hello,
I got quite an easy question I guess.
Does unistd.h declare functions in the kernel or in the stdclib? Or in any other C file.
I need to know from the inside how some of the functions work.
So where does unistd redirect to?
Thanks
Cheers,
Robin
- 04-20-2010 #2Linux Newbie
- Join Date
- Apr 2010
- Location
- Novosibirsk, Russia
- Posts
- 136
as I remember, linux kernel uses libc itself...) but in any case, if you want to know how a function works, you can search it in kernel source, or just compile kernel in debug mode and use gcc by your hands
I think it could be useful to read kernel docs too (something about unistd... Or just try 'man unistd' command
).
- 04-20-2010 #3
I don't fully understand your question.
unistd.h is a part of glibc, which is the GNU implementation of the C library. glibc is an external library loaded into pretty much every executable (ones compiled from C, at least), but it is not included in the kernel. Kernel programming uses a separate set of libraries that are kernel-specific, and kernel programming cannot use normal libc functions.DISTRO=Arch
Registered Linux User #388732
- 04-27-2010 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
While true that glibc and libc are not used directly by the kernel, the kernel has it's own version of unistd.h and other common headers in linux-src-dir/include/linux, so in kernel code you would #include <linux/unistd.h> in order to get unistd.h functions. In any case, do read the docs.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-28-2010 #5


Reply With Quote
