tags:

views:

190

answers:

5

Where i can find implementation of time.h i.e time.c I tried with Google Code Search time.c Is the implementaion is in Linux Kernel ?

+2  A: 

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.

tonio
And to complete the answer: no, `time.c` in the linux kernel is not the implementation for `time.h`. From the header comments there: `This file contains the interface functions for the various time related system calls: time, stime, gettimeofday, settimeofday, adjtime`, so this has nothing to do with `libc` `time.h`.
tonio
A: 

time.h is a C standard header, so it describes functions from the C standard library with which it came. For instance, GNU libc

MSalters
A: 

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.

Marcelo Cantos
+1  A: 

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

Uri