Reputation: 1081
Where can I find the implementation of time.h in the C Standard Library, i.e time.c
?
I tried with Google Code Search time.c Is the implementation in the Linux kernel?
Upvotes: 6
Views: 10798
Reputation: 89749
Are you actually looking for the implementation of C in the standard library? Each compiler and OS typically comes with their own implementation (just the headers are relatively standard).
You can see instructions on downloading the sources for GNU C here: http://www.gnu.org/software/libc/resources.html
Upvotes: 1
Reputation: 37208
For GNU libc, see http://sourceware.org/git/?p=glibc.git;a=tree;f=time;h=c950c5d4dd90541e8f3c7e1649fcde4aead989bb;hb=master
Upvotes: 4
Reputation: 185902
You can find an implementation in the GNU libc library. There isn't a single time.c file. Each function (to a first approximation) lives in its own compilation unit.
Upvotes: 1
Reputation: 179917
time.h
is a C standard header, so it describes functions from the C standard library with which it came. For instance, GNU libc
Upvotes: 0
Reputation: 10541
time.h
is a header from the C standard library.
You will find implementations of the various functions this header provides in the c library implementation of your system.
For instance, the implementation for the difftime
function in the libc
used for NetBSD can be found in src/lib/libc/time/difftime.c.
Upvotes: 5