Back to index

glibc  2.9
reboot.c File Reference
#include <errno.h>
#include <unistd.h>
#include <hurd.h>
#include <hurd/startup.h>
#include <sys/reboot.h>

Go to the source code of this file.


int reboot (int howto)

Function Documentation

int reboot ( int  howto)

Definition at line 27 of file reboot.c.

  error_t err;
  startup_t init;
  mach_port_t hostpriv;

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

  err = __USEPORT (PROC, __proc_getmsgport (port, 1, &init));
  if (!err)
      err = __startup_reboot (init, hostpriv, howto);
      __mach_port_deallocate (__mach_task_self (), init);

  __mach_port_deallocate (__mach_task_self (), hostpriv);

  if (err)
    return __hurd_fail (err);

  return 0;

Here is the call graph for this function: