You are not logged in.
I've started to program some in C after reading dussins of tutorials manuals etc.
But now i want to be able to find out how the functions i use was written in gcc, granted mostly out of nerdy curiosity. As i've understood it the complier is written in C and as such it should somewhere in the source have a function written that's called gethostname() right? The declaration is in a header, sure... But when i try to grep out the source of gcc4.4.3 i only find a gethostname() function written for fortran, not C.
What am i missing? is all these functions written somewhere else?
Last edited by jumzi (2010-03-19 14:02:13)
Offline
That function is provided by glibc.
Offline
GCC is *just* the compiler. It translates human-readable code (well, for a given value of 'readable' ) to object (binary) code. gethostname() is in the glibc source.
glibc is the library that provides pretty much everything you'd commonly do in C, hence the name 'GNU C Library'.
Offline
You can get the source code here
Offline
Aah! Thanks, been drinking abit this morning... Things tend become messy in the old head thingy :]
Offline