Back to index

glibc  2.9
setpgid.c File Reference
#include <errno.h>
#include <unistd.h>
#include <hurd.h>
#include <hurd/port.h>

Go to the source code of this file.


int __setpgid (pid_t pid, pid_t pgid)

Function Documentation

int __setpgid ( pid_t  pid,
pid_t  pgid 

Definition at line 28 of file setpgid.c.

  error_t err;
  unsigned int stamp;

  stamp = _hurd_pids_changed_stamp; /* Atomic fetch.  */

  if (err = __USEPORT (PROC, __proc_setpgrp (port, pid, pgid)))
    return __hurd_fail (err);

  if (pid == 0 || pid == _hurd_pid)
    /* Synchronize with the signal thread to make sure we have
       received and processed proc_newids before returning to the user.  */
    while (_hurd_pids_changed_stamp == stamp)
#ifdef noteven
       /* XXX we have no need for a mutex, but cthreads demands one.  */
       __condition_wait (&_hurd_pids_changed_sync, NULL);

  return 0;


Here is the call graph for this function:

Here is the caller graph for this function: