santosh wrote:
struct timeval is a GNU C extension.
http://opengroup.org/onlinepubs/0096...ys/time.h.html
The <sys/time.hheader shall define the timeval structure that
includes at least the following members:
time_t tv_sec Seconds.
suseconds_t tv_usec Microseconds.
The time_t and suseconds_t types shall be defined as described
in <sys/types.h>.
time_t and clock_t shall be integer or real-floating types.
The type suseconds_t shall be a signed integer type capable of
storing values at least in the range [-1, 1000000].
There are no specific format specifiers for this [...]
Right.
(However, glibc does allow custom conversion specifiers.)
http://www.gnu.org/software/libc/man...ng-Printf.html
but since the structure members are of type long int
you can use the 'ld' format specifier for printing them.
AFAIU, it is possible for time_t to be wider than long int, but
I'm not sure. Consider a platform where time_t is 64 bits wide
and long int is only 32 bits wide.
For furher GNU C related questions please ask in a GNU group
or in a Linux group.
comp.unix.programmer for Unix-related questions.
gnu.gcc.help for GCC-specific questions.