Back to index

glibc  2.9
Defines | Functions
utmp32.c File Reference
#include <sys/types.h>
#include <utmp.h>
#include <errno.h>
#include <libc-symbols.h>
#include "utmp32.h"
#include "utmp-convert.h"

Go to the source code of this file.

Defines

#define ALLOCATE_UTMP32_OUT(OUT)
#define ACCESS_UTMP_ENTRY(FUNC, FIELD)

Functions

struct utmp32getutid32 (const struct utmp32 *id)
 symbol_version (getutid32, getutid, GLIBC_2.0)
struct utmp32getutline32 (const struct utmp32 *line)
 symbol_version (getutline32, getutline, GLIBC_2.0)
struct utmp32pututline32 (const struct utmp32 *utmp_ptr)
 symbol_version (pututline32, pututline, GLIBC_2.0)
struct utmp32getutent32 (void)
 symbol_version (getutent32, getutent, GLIBC_2.0)
int getutent32_r (struct utmp32 *buffer, struct utmp32 **result)
 symbol_version (getutent32_r, getutent_r, GLIBC_2.0)
int getutid32_r (const struct utmp32 *id, struct utmp32 *buffer, struct utmp32 **result)
 symbol_version (getutid32_r, getutid_r, GLIBC_2.0)
int getutline32_r (const struct utmp32 *line, struct utmp32 *buffer, struct utmp32 **result)
 symbol_version (getutline32_r, getutline_r, GLIBC_2.0)
void updwtmp32 (const char *wtmp_file, const struct utmp32 *utmp)
 symbol_version (updwtmp32, updwtmp, GLIBC_2.0)

Define Documentation

#define ACCESS_UTMP_ENTRY (   FUNC,
  FIELD 
)
Value:
struct utmp in64;                                \
  struct utmp *out64;                                   \
  ALLOCATE_UTMP32_OUT (out32);                          \
							\
  utmp_convert32to64 (FIELD, &in64);                    \
  out64 = FUNC (&in64);                                 \
                                                 \
  if (out64 == NULL)                             \
    return NULL;                                 \
							\
  utmp_convert64to32 (out64, out32);                    \
                                                 \
  return out32;

Definition at line 45 of file utmp32.c.

#define ALLOCATE_UTMP32_OUT (   OUT)
Value:
static struct utmp32 *OUT = NULL;                \
                                                 \
  if (OUT == NULL)                               \
    {                                            \
      OUT = malloc (sizeof (struct utmp32));            \
      if (OUT == NULL)                                  \
       return NULL;                              \
    }

Definition at line 32 of file utmp32.c.


Function Documentation

struct utmp32* getutent32 ( void  ) [read]

Definition at line 88 of file utmp32.c.

{
  struct utmp *out64;
  ALLOCATE_UTMP32_OUT (out32);

  out64 = getutent ();
  if (!out64)
    return NULL;

  utmp_convert64to32 (out64, out32);
  return out32;
}

Here is the call graph for this function:

int getutent32_r ( struct utmp32 buffer,
struct utmp32 **  result 
)

Definition at line 105 of file utmp32.c.

{
  struct utmp out64;
  struct utmp *out64p;
  int ret;

  ret = getutent_r (&out64, &out64p);
  if (ret == -1)
    {
      *result = NULL;
      return -1;
    }

  utmp_convert64to32 (out64p, buffer);
  *result = buffer;

  return 0;
}

Here is the call graph for this function:

struct utmp32* getutid32 ( const struct utmp32 id) [read]

Definition at line 63 of file utmp32.c.

Here is the call graph for this function:

int getutid32_r ( const struct utmp32 id,
struct utmp32 buffer,
struct utmp32 **  result 
)

Definition at line 126 of file utmp32.c.

{
  struct utmp in64;
  struct utmp out64;
  struct utmp *out64p;
  int ret;

  utmp_convert32to64 (id, &in64);

  ret = getutid_r (&in64, &out64, &out64p);
  if (ret == -1)
    {
      *result = NULL;
      return -1;
    }

  utmp_convert64to32 (out64p, buffer);
  *result = buffer;

  return 0;
}

Here is the call graph for this function:

struct utmp32* getutline32 ( const struct utmp32 line) [read]

Definition at line 72 of file utmp32.c.

Here is the call graph for this function:

int getutline32_r ( const struct utmp32 line,
struct utmp32 buffer,
struct utmp32 **  result 
)

Definition at line 151 of file utmp32.c.

{
  struct utmp in64;
  struct utmp out64;
  struct utmp *out64p;
  int ret;

  utmp_convert32to64 (line, &in64);

  ret = getutline_r (&in64, &out64, &out64p);
  if (ret == -1)
    {
      *result = NULL;
      return -1;
    }

  utmp_convert64to32 (out64p, buffer);
  *result = buffer;

  return 0;

}

Here is the call graph for this function:

struct utmp32* pututline32 ( const struct utmp32 utmp_ptr) [read]

Definition at line 80 of file utmp32.c.

{
  ACCESS_UTMP_ENTRY (pututline, utmp_ptr)
}

Here is the call graph for this function:

symbol_version ( getutid32  ,
getutid  ,
GLIBC_2.  0 
)
symbol_version ( getutline32  ,
getutline  ,
GLIBC_2.  0 
)
symbol_version ( pututline32  ,
pututline  ,
GLIBC_2.  0 
)
symbol_version ( getutent32  ,
getutent  ,
GLIBC_2.  0 
)
symbol_version ( getutent32_r  ,
getutent_r  ,
GLIBC_2.  0 
)
symbol_version ( getutid32_r  ,
getutid_r  ,
GLIBC_2.  0 
)
symbol_version ( getutline32_r  ,
getutline_r  ,
GLIBC_2.  0 
)
symbol_version ( updwtmp32  ,
updwtmp  ,
GLIBC_2.  0 
)
void updwtmp32 ( const char *  wtmp_file,
const struct utmp32 utmp 
)

Definition at line 178 of file utmp32.c.

{
  struct utmp in32;

  utmp_convert32to64 (utmp, &in32);
  updwtmp (wtmp_file, &in32);
}

Here is the call graph for this function: