Go to the previous, next section.

gettimeofday and settimeofday

SYNOPSIS

int gettimeofday(struct timeval *tv, struct timezone *tz);

int settimeofday(const struct timeval *tv, const struct timezone *tz);

PARAMETERS

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.

DESCRIPTION

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.

RETURN VALUE

On success zero is returned. On error -1 is returned and errno is set to one of the following values:

Go to the previous, next section.