Back to index

glibc  2.9
Defines | Functions
utmp.h File Reference
#include <features.h>
#include <sys/types.h>
#include <bits/utmp.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define UTMP_FILE   _PATH_UTMP
#define UTMP_FILENAME   _PATH_UTMP
#define WTMP_FILE   _PATH_WTMP
#define WTMP_FILENAME   _PATH_WTMP

Functions

int login_tty (int __fd) __THROW
void login (__const struct utmp *__entry) __THROW
int logout (__const char *__ut_line) __THROW
void logwtmp (__const char *__ut_line, __const char *__ut_name, __const char *__ut_host) __THROW
void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp) __THROW
int utmpname (__const char *__file) __THROW
struct utmpgetutent (void) __THROW
void setutent (void) __THROW
void endutent (void) __THROW
struct utmpgetutid (__const struct utmp *__id) __THROW
struct utmpgetutline (__const struct utmp *__line) __THROW
struct utmppututline (__const struct utmp *__utmp_ptr) __THROW

Define Documentation

#define UTMP_FILE   _PATH_UTMP

Definition at line 33 of file utmp.h.

#define UTMP_FILENAME   _PATH_UTMP

Definition at line 34 of file utmp.h.

#define WTMP_FILE   _PATH_WTMP

Definition at line 35 of file utmp.h.

#define WTMP_FILENAME   _PATH_WTMP

Definition at line 36 of file utmp.h.


Function Documentation

void endutent ( void  )

Here is the caller graph for this function:

struct utmp* getutent ( void  ) [read]

Here is the caller graph for this function:

struct utmp* getutid ( __const struct utmp __id) [read]

Here is the caller graph for this function:

struct utmp* getutline ( __const struct utmp __line) [read]

Here is the caller graph for this function:

void login ( __const struct utmp __entry)
int login_tty ( int  __fd)

Definition at line 42 of file login_tty.c.

{
       (void) setsid();
#ifdef TIOCSCTTY
       if (ioctl(fd, TIOCSCTTY, (char *)NULL) == -1)
              return (-1);
#else
       {
         /* This might work.  */
         char *fdname = ttyname (fd);
         int newfd;
         if (fdname)
           {
             if (fd != 0)
              (void) close (0);
             if (fd != 1)
              (void) close (1);
             if (fd != 2)
              (void) close (2);
             newfd = open (fdname, O_RDWR);
             (void) close (newfd);
           }
       }
#endif
       while (dup2(fd, 0) == -1 && errno == EBUSY)
         ;
       while (dup2(fd, 1) == -1 && errno == EBUSY)
         ;
       while (dup2(fd, 2) == -1 && errno == EBUSY)
         ;
       if (fd > 2)
              (void) close(fd);
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int logout ( __const char *  __ut_line)
void logwtmp ( __const char *  __ut_line,
__const char *  __ut_name,
__const char *  __ut_host 
)
struct utmp* pututline ( __const struct utmp __utmp_ptr) [read]

Here is the caller graph for this function:

void setutent ( void  )

Here is the caller graph for this function:

void updwtmp ( __const char *  __wtmp_file,
__const struct utmp __utmp 
)

Here is the caller graph for this function:

int utmpname ( __const char *  __file)

Here is the caller graph for this function: