Back to index

glibc  2.9
Functions
settimeofday.c File Reference
#include <errno.h>
#include <time.h>
#include <sys/time.h>

Go to the source code of this file.

Functions

int __settimeofday (struct timeval *tv, const struct timezone *tz) const

Function Documentation

int __settimeofday ( struct timeval tv,
const struct timezone *  tz 
) const

Definition at line 26 of file settimeofday.c.

{
  time_t when;

  if (tv == NULL)
    {
      __set_errno (EINVAL);
      return -1;
    }

  if (tz != NULL || tv->tv_usec % 1000000 != 0)
    {
      __set_errno (ENOSYS);
      return -1;
    }

  when = tv->tv_sec + (tv->tv_usec / 1000000);
  return stime (&when);
}

Here is the call graph for this function: