Back to index

glibc  2.9
Classes | Functions
id.h File Reference
#include <features.h>
#include <cthreads.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hurd_id_data
struct  hurd_id_data.gen
struct  hurd_id_data.aux

Functions

error_t _hurd_check_ids (void)

Class Documentation

struct hurd_id_data

Definition at line 29 of file id.h.

Class Members
struct hurd_id_data aux
struct hurd_id_data gen
auth_t rid_auth
int valid
struct hurd_id_data.gen

Definition at line 35 of file id.h.

Class Members
gid_t * gids
mach_msg_type_number_t ngids
mach_msg_type_number_t nuids
uid_t * uids
struct hurd_id_data.aux

Definition at line 35 of file id.h.

Class Members
gid_t * gids
mach_msg_type_number_t ngids
mach_msg_type_number_t nuids
uid_t * uids

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: