Back to index

glibc  2.9
Functions | Variables
hurdpid.c File Reference
#include <hurd.h>
#include <hurd/msg_server.h>
#include "set-hooks.h"
#include <cthreads.h>

Go to the source code of this file.

Functions

static void init_pids (void)
 text_set_element (_hurd_proc_subinit, init_pids)
 DEFINE_HOOK (_hurd_pgrp_changed_hook,(pid_t))
kern_return_t _S_msg_proc_newids (mach_port_t me, task_t task, pid_t ppid, pid_t pgrp, int orphaned)

Variables

pid_t _hurd_pid
pid_t _hurd_ppid
pid_t _hurd_pgrp
int _hurd_orphaned
unsigned int _hurd_pids_changed_stamp

Function Documentation

kern_return_t _S_msg_proc_newids ( mach_port_t  me,
task_t  task,
pid_t  ppid,
pid_t  pgrp,
int  orphaned 
)

Definition at line 48 of file hurdpid.c.

{
  int pgrp_changed;

  if (task != __mach_task_self ())
    return EPERM;

  __mach_port_deallocate (__mach_task_self (), task);

  pgrp_changed = pgrp != _hurd_pgrp;
  _hurd_ppid = ppid;
  _hurd_pgrp = pgrp;
  _hurd_orphaned = orphaned;

  if (pgrp_changed)
    /* Run things that want notification of a pgrp change.  */
    RUN_HOOK (_hurd_pgrp_changed_hook, (pgrp));

  /* Notify any waiting user threads that the id change as been completed.  */
  ++_hurd_pids_changed_stamp;

  return 0;
}

Here is the call graph for this function:

DEFINE_HOOK ( _hurd_pgrp_changed_hook  ,
(pid_t  
)
static void init_pids ( void  ) [static]

Definition at line 24 of file hurdpid.c.

{
  __USEPORT (PROC,
            ({
              __proc_getpids (port, &_hurd_pid, &_hurd_ppid, &_hurd_orphaned);
              __proc_getpgrp (port, _hurd_pid, &_hurd_pgrp);
            }));

  (void) &init_pids;        /* Avoid "defined but not used" warning.  */
}
text_set_element ( _hurd_proc_subinit  ,
init_pids   
)

Variable Documentation

Definition at line 21 of file hurdpid.c.

Definition at line 20 of file hurdpid.c.

Definition at line 20 of file hurdpid.c.

Definition at line 44 of file hurdpid.c.

Definition at line 20 of file hurdpid.c.