Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c

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?

like image 897
mohit Avatar asked Apr 13 '10 12:04

mohit


People also ask

What does #include time H mean?

The time. h header file contains definitions of functions to get and manipulate date and time information. It describes three time-related data types. clock_t: clock_t represents the date as an integer which is a part of the calendar time.

What is time h header file in C?

In C programming language time. h (used as ctime in C++) is a header file defined in the C Standard Library that contains time and date function declarations to provide standardized access to time/date manipulation and formatting.


2 Answers

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.

like image 159
tonio Avatar answered Oct 13 '22 22:10

tonio


For GNU libc, see http://sourceware.org/git/?p=glibc.git;a=tree;f=time;h=c950c5d4dd90541e8f3c7e1649fcde4aead989bb;hb=master

like image 4
janneb Avatar answered Oct 13 '22 22:10

janneb