3 <<time>>---get current calendar time (as single number)
10 time_t time(time_t *<[t]>);
13 <<time>> looks up the best available representation of the current
14 time and returns it, encoded as a <<time_t>>. It stores the same
15 value at <[t]> unless the argument is <<NULL>>.
18 A <<-1>> result means the current time is not available; otherwise the
19 result represents the current time.
22 ANSI C requires <<time>>.
24 Supporting OS subroutine required: Some implementations require
28 /* Most times we have a system call in newlib/libc/sys/.. to do this job */
32 #include <sys/types.h>
40 now
.tv_sec
= (time_t) -1;
42 if (_gettimeofday_r (_REENT
, &now
, NULL
) < 0)
43 now
.tv_sec
= (time_t) -1;