Back to index

glibc  2.9
Classes | Defines | Functions
shadow.h File Reference
#include <features.h>
#include <paths.h>
#include <stdio.h>
#include <stddef.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  spwd


#define __need_FILE
#define __need_size_t


void setspent (void)
void endspent (void)
struct spwdgetspent (void)
struct spwdgetspnam (__const char *__name)
struct spwdsgetspent (__const char *__string)
struct spwdfgetspent (FILE *__stream)
int putspent (__const struct spwd *__p, FILE *__stream)
int lckpwdf (void) __THROW
int ulckpwdf (void) __THROW

Class Documentation

struct spwd

Definition at line 40 of file shadow.h.

Class Members
long int sp_expire
unsigned long int sp_flag
long int sp_inact
long int sp_lstchg
long int sp_max
long int sp_min
char * sp_namp
char * sp_pwdp
long int sp_warn

Define Documentation

#define __need_FILE

Definition at line 28 of file shadow.h.

#define __need_size_t

Definition at line 30 of file shadow.h.


Definition at line 34 of file shadow.h.

Function Documentation

void endspent ( void  )
struct spwd* fgetspent ( FILE __stream) [read]

Definition at line 36 of file fgetspent.c.

  static size_t buffer_size;
  static struct spwd resbuf;
  fpos_t pos;
  struct spwd *result;
  int save;

  if (fgetpos (stream, &pos) != 0)
    return NULL;

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

  /* Allocate buffer if not yet available.  */
  if (buffer == NULL)
      buffer_size = BUFLEN_SPWD;
      buffer = malloc (buffer_size);

  while (buffer != NULL
        && (__fgetspent_r (stream, &resbuf, buffer, buffer_size, &result)
            == ERANGE))
      char *new_buf;
      buffer_size += BUFLEN_SPWD;
      new_buf = realloc (buffer, buffer_size);
      if (new_buf == NULL)
         /* We are out of memory.  Free the current buffer so that the
            process gets a chance for a normal termination.  */
         save = errno;
         free (buffer);
         __set_errno (save);
      buffer = new_buf;

      /* Reset the stream.  */
      if (fsetpos (stream, &pos) != 0)
       buffer = NULL;

  if (buffer == NULL)
    result = NULL;

  /* Release lock.  Preserve error value.  */
  save = errno;
  __libc_lock_unlock (lock);
  __set_errno (save);

  return result;

Here is the call graph for this function:

struct spwd* getspent ( void  ) [read]

Here is the caller graph for this function:

struct spwd* getspnam ( __const char *  __name) [read]

Here is the caller graph for this function:

int lckpwdf ( void  )
int putspent ( __const struct spwd __p,
FILE __stream 
void setspent ( void  )

Here is the caller graph for this function:

struct spwd* sgetspent ( __const char *  __string) [read]
int ulckpwdf ( void  )