Back to index

glibc  2.9
Defines | Functions
getXXent.c File Reference
#include <errno.h>
#include <bits/libc-lock.h>
#include <stdlib.h>
#include "nsswitch.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define REENTRANT_GETNAME   APPEND_R (GETFUNC_NAME)
#define APPEND_R(name)   APPEND_R1 (name)
#define APPEND_R1(name)   name##_r
#define INTERNAL(name)   INTERNAL1 (name)
#define INTERNAL1(name)   __##name
#define H_ERRNO_PARM
#define H_ERRNO_VAR   NULL

Functions

int INTERNAL() REENTRANT_GETNAME (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen, LOOKUP_TYPE **result H_ERRNO_PARM)
 __libc_lock_define_initialized (static, lock)
 libc_freeres_ptr (static char *buffer)
LOOKUP_TYPEGETFUNC_NAME (void)

Define Documentation

#define APPEND_R (   name)    APPEND_R1 (name)

Definition at line 43 of file getXXent.c.

#define APPEND_R1 (   name)    name##_r

Definition at line 44 of file getXXent.c.

#define H_ERRNO_PARM

Definition at line 53 of file getXXent.c.

#define H_ERRNO_VAR   NULL

Definition at line 54 of file getXXent.c.

#define INTERNAL (   name)    INTERNAL1 (name)

Definition at line 45 of file getXXent.c.

#define INTERNAL1 (   name)    __##name

Definition at line 46 of file getXXent.c.

Definition at line 42 of file getXXent.c.


Function Documentation

__libc_lock_define_initialized ( static  ,
lock   
)

Definition at line 34 of file getnetgrent_r.c.

{
  /* Remember the first service_entry, it's always the same.  */
  static bool startp_initialized;
  static service_user *startp;
  int no_more;

  if (!startp_initialized)
    {
      /* Executing this more than once at the same time must yield the
        same result every time.  So we need no locking.  */
      no_more = __nss_netgroup_lookup (nipp, "setnetgrent", fctp);
      startp = no_more ? (service_user *) -1 : *nipp;
      PTR_MANGLE (startp);
      atomic_write_barrier ();
      startp_initialized = true;
    }
  else
    {
      service_user *nip = startp;
      PTR_DEMANGLE (nip);
      if (nip == (service_user *) -1)
       /* No services at all.  */
       return 1;

      /* Reset to the beginning of the service list.  */
      *nipp = nip;
      /* Look up the first function.  */
      no_more = __nss_lookup (nipp, "setnetgrent", NULL, fctp);
    }
  return no_more;
}

Definition at line 70 of file getXXent.c.

{
  static size_t buffer_size;
  static union
  {
    LOOKUP_TYPE l;
    void *ptr;
  } resbuf;
  LOOKUP_TYPE *result;
  int save;

  /* Get lock.  */
  __libc_lock_lock (lock);

  result = (LOOKUP_TYPE *)
    __nss_getent ((getent_r_function) INTERNAL (REENTRANT_GETNAME),
                &resbuf.ptr, &buffer, BUFLEN, &buffer_size,
                H_ERRNO_VAR);

  save = errno;
  __libc_lock_unlock (lock);
  __set_errno (save);
  return result;
}

Here is the call graph for this function:

libc_freeres_ptr ( static char *  buffer)
int INTERNAL() REENTRANT_GETNAME ( LOOKUP_TYPE resbuf,
char *  buffer,
size_t  buflen,
LOOKUP_TYPE **result  H_ERRNO_PARM 
)

Definition at line 155 of file getXXent_r.c.

Here is the call graph for this function: