Back to index

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

Go to the source code of this file.


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 27 of file settimeofday.c.

  error_t err;
  mach_port_t hostpriv;

  if (tz != NULL)
      errno = ENOSYS;
      return -1;

  err = __get_privileged_ports (&hostpriv, NULL);
  if (err)
    return __hurd_fail (EPERM);

  /* `time_value_t' and `struct timeval' are in fact identical with the
     names changed.  */
  err = __host_set_time (hostpriv, *(time_value_t *) tv);
  __mach_port_deallocate (__mach_task_self (), hostpriv);

  if (err)
    return __hurd_fail (err);

  return 0;

Here is the call graph for this function: