__time

OS/161 Reference Manual

Name

__time - get time of day

Library

Standard C Library (libc, -lc)

Synopsis

#include <time.h>

time_t
__time(time_t *seconds, uint32_t *nanoseconds);

Description

The current time (in seconds and nanoseconds since midnight GMT on January 1, 1970) is retrieved. If seconds and/or nanoseconds are non-null, the corresponding components of the time are stored through those pointers. The time in seconds is also returned.

Return Values

__time returns 0 on success. On error, -1 is returned, and errno is set to indicate the error.

Errors

The following error is the only way __time should be capable of failing.
  
EFAULT seconds or nanoseconds was an invalid non-NULL address.

See Also

time