## 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 *`ptr`);`

### Description

The current time (in seconds since midnight GMT on January 1, 1970) is retrieved. If ptr is non-null, the time is stored through ptr. The time is also returned.

time is a wrapper around the system call __time, which returns nanoseconds as well as seconds.

### Return Values

`time` returns the time. 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 | ptr was an invalid non-NULL address.