linux - [Solved-5 Solutions] What is ultimately a time_t typedef to ? - ubuntu - red hat - debian - linux server - linux pc
Linux - Problem :
What is ultimately a time_t typedef to ?
Linux - Solution 1:
- The time_t datatype is a data type in the ISO C library defined for storing system time values.
- Such values are returned from the standard time() library function.
- This type is a typedef defined in the standard header. ISO C defines time_t as an arithmetic type, but does not specify any particular type, range, resolution, or encoding for it.
- Also unspecified are the meanings of arithmetic operations applied to time values.
- Unix and POSIX-compliant systems implement the time_t type as a signed integer which represents the number of seconds since the start of the Unix epoch
Linux - Solution 2:
It's defined in $INCDIR/bits/types.h
Linux - Solution 3:
- Typically you will find these underlying implementation-specific typedefs for gcc in the bits or asm header directory.
- For Example: /usr/include/x86_64-linux-gnu/bits/types.h
Linux - Solution 4:
Under Visual Studio 2008, it defaults to an __int64 unless you define _USE_32BIT_TIME_T.
Linux - Solution 5:
time_t is of type long int on 64 bit machines, else it is long long int.
You could verify this in these header files:
4) Again in types.h