COHERENT manpages

This page displays the COHERENT manpage for time() [Get current system time].

List of available manpages
Index


time() -- System Call (libc)

Get current system time
#include <time.h>
time_t time(tp)
time_t *tp;

time() reads  and returns  the current  system time.  COHERENT  defines the
current  system  time as  the  number  of seconds  since  January 1,  1970,
0h00m00s GMT.

tp  points to  a data  element of  the type time_t,  which the  header file
time.h defines  as being equivalent  to a long.  If tp is  initialized to a
value other than  NULL, then time() attempts to write  the system time into
the address  to which tp points.   If, however, tp is  initialized to NULL,
then time() returns  the current system time but does  not attempt to write
it anywhere.

Example

For an example of this call, see the entry for asctime().

See Also

date,
libc,
time [overview],
time.h
ANSI Standard, §7.12.2.4
POSIX Standard, §4.5.1

Notes

UNIX System  V defines time_t  in header file  <sys/types.h>, whereas
COHERENT  defines it  in  time.h. This  should  not affect  the porting  of
programs from UNIX  to COHERENT, but it may affect  the porting of programs
in the other direction.