1

I am wondering where the implementations (.c or .cpp files) are in the Linux system for the core header files. For example, where is the implementation of sys/socket.h stored?

4

3 回答 3

4

The implementation is in GNU libc. You can browse GNU libc sources or download them from gnu.org

Some useful links are in the answer to "Where can I browse the source code of libc online?"

于 2012-05-19T08:14:40.823 回答
3

The functions in these headers are typically system calls. System calls provide a mechanism to talk to the kernel space functionality . in this perticular example access the tcp/ip stack functionality.

http://www.ibm.com/developerworks/aix/library/au-tcpsystemcalls/

于 2012-05-19T08:15:37.217 回答
1

try the linux source tarball from kernel.org or if you're into glibc and the like, their home pages. For the most part this stuff is not distributed with most distributions, but gentoo does and it's in /usr/src

于 2012-05-19T08:15:20.930 回答