Back to index

glibc  2.9
Functions
hurdid.c File Reference
#include <hurd.h>
#include <hurd/id.h>

Go to the source code of this file.

Functions

error_t _hurd_check_ids (void)
static void init_id (void)
 text_set_element (_hurd_preinit_hook, init_id)

Function Documentation

Definition at line 29 of file hurdid.c.

{
  if (! _hurd_id.valid)
    {
      inline void dealloc (__typeof (_hurd_id.gen) *p)
       {
         if (p->uids)
           {
             __vm_deallocate (__mach_task_self (),
                            (vm_address_t) p->uids,
                            p->nuids * sizeof (uid_t));
             p->uids = NULL;
           }
         p->nuids = 0;
         if (p->gids)
           {
             __vm_deallocate (__mach_task_self (),
                            (vm_address_t) p->gids,
                            p->ngids * sizeof (gid_t));
             p->gids = NULL;
           }
         p->ngids = 0;
       }

      error_t err;

      dealloc (&_hurd_id.gen);
      dealloc (&_hurd_id.aux);

      if (_hurd_id.rid_auth != MACH_PORT_NULL)
       {
         __mach_port_deallocate (__mach_task_self (), _hurd_id.rid_auth);
         _hurd_id.rid_auth = MACH_PORT_NULL;
       }

      if (err = __USEPORT (AUTH, __auth_getids
                        (port,
                         &_hurd_id.gen.uids, &_hurd_id.gen.nuids,
                         &_hurd_id.aux.uids, &_hurd_id.aux.nuids,
                         &_hurd_id.gen.gids, &_hurd_id.gen.ngids,
                         &_hurd_id.aux.gids, &_hurd_id.aux.ngids)))
       return err;

      _hurd_id.valid = 1;
    }

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_id ( void  ) [static]

Definition at line 79 of file hurdid.c.

{
  __mutex_init (&_hurd_id.lock);
  _hurd_id.valid = 0;
  _hurd_id.rid_auth = MACH_PORT_NULL;
  _hurd_id.gen.uids = _hurd_id.aux.uids = NULL;
  _hurd_id.gen.nuids = _hurd_id.aux.nuids = 0;
  _hurd_id.gen.gids = _hurd_id.aux.gids = NULL;
  _hurd_id.gen.ngids = _hurd_id.aux.ngids = 0;

  (void) &init_id;          /* Avoid "defined but not used" warning.  */
}

Here is the call graph for this function:

text_set_element ( _hurd_preinit_hook  ,
init_id   
)