Back to index

glibc  2.9
Functions
group_member.c File Reference
#include <errno.h>
#include <unistd.h>
#include <hurd.h>
#include <hurd/id.h>

Go to the source code of this file.

Functions

int __group_member (gid_t gid)

Function Documentation

Definition at line 26 of file group_member.c.

{
  int member = 0;
  error_t err;
  void *crit;

  crit = _hurd_critical_section_lock ();
  __mutex_lock (&_hurd_id.lock);

  err = _hurd_check_ids ();
  if (! err)
    {
      size_t i;
      for (i = 0; i < _hurd_id.gen.ngids; ++i)
       if (_hurd_id.gen.gids[i] == gid)
         {
           member = 1;
           break;
         }
    }

  __mutex_unlock (&_hurd_id.lock);
  _hurd_critical_section_unlock (crit);

  if (err)
    __hurd_fail (err);
  return member;
}

Here is the call graph for this function: