Go to the previous, next section.
int gettimeofday(struct timeval *tv, struct timezone *tz);
int settimeofday(const struct timeval *tv, const struct
timezone *tz);
tv: for gettimeofday
, [out] points to a buffer that will
contain the time. For settimeofday
, [in] points to a buffer
containing the new time.
tz: for gettimeofday
, [out] points to a buffer that will
contain the timezone information. For settimeofday
, [in] points
to a buffer containing the new timezone information.
gettimeofday
retreives the current time and timezone information.
settimeofday
sets the current time and timezone information. Only
the superuser may call settimeofday
. A value of NULL
for a
parameter of settimeofday
specifies not to change this parameter.
On success zero is returned. On error -1 is returned and errno
is
set to one of the following values:
EPERM
: settimeofday
was called but the task has not
superuser privileges.
EINVAL
.
Go to the previous, next section.