mohit
mohit

Reputation: 1081

Where can I find the implementation of "time.h"?

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

Answers (5)

Uri
Uri

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

Marcelo Cantos
Marcelo Cantos

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

MSalters
MSalters

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

tonio
tonio

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

Related Questions