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?
Asked
Active
Viewed 176 times
1
-
1May or may not be present at all depends on the implementation I guess, they could only provide the libraries and the header files. – Alok Save May 19 '12 at 08:12
-
1You need to understand what a system call http://en.wikipedia.org/wiki/System_call is and what is the role of the Linux kernel http://en.wikipedia.org/wiki/Linux_kernel ; notice that from an application point of view, a system call is atomic – Basile Starynkevitch May 19 '12 at 08:48
3 Answers
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?"

Community
- 1
- 1

Dima Chubarov
- 16,199
- 6
- 40
- 76
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/

Jay D
- 3,263
- 4
- 32
- 48
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

Mike Ramirez
- 10,750
- 3
- 26
- 20