Back to index

glibc  2.9
utmpx.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef       _UTMPX_H
00020 #define       _UTMPX_H      1
00021 
00022 #include <features.h>
00023 #include <sys/time.h>
00024 
00025 /* Required according to Unix98.  */
00026 #ifndef __pid_t_defined
00027 typedef __pid_t pid_t;
00028 # define __pid_t_defined
00029 #endif
00030 
00031 /* Get system dependent values and data structures.  */
00032 #include <bits/utmpx.h>
00033 
00034 #ifdef __USE_GNU
00035 /* Compatibility names for the strings of the canonical file names.  */
00036 # define UTMPX_FILE  _PATH_UTMPX
00037 # define UTMPX_FILENAME     _PATH_UTMPX
00038 # define WTMPX_FILE  _PATH_WTMPX
00039 # define WTMPX_FILENAME     _PATH_WTMPX
00040 #endif
00041 
00042 /* For the getutmp{,x} functions we need the `struct utmp'.  */
00043 #ifdef __USE_GNU
00044 struct utmp;
00045 #endif
00046 
00047 
00048 __BEGIN_DECLS
00049 
00050 /* Open user accounting database.  */
00051 extern void setutxent (void) __THROW;
00052 
00053 /* Close user accounting database.  */
00054 extern void endutxent (void) __THROW;
00055 
00056 /* Get the next entry from the user accounting database.  */
00057 extern struct utmpx *getutxent (void) __THROW;
00058 
00059 /* Get the user accounting database entry corresponding to ID.  */
00060 extern struct utmpx *getutxid (__const struct utmpx *__id) __THROW;
00061 
00062 /* Get the user accounting database entry corresponding to LINE.  */
00063 extern struct utmpx *getutxline (__const struct utmpx *__line) __THROW;
00064 
00065 /* Write the entry UTMPX into the user accounting database.  */
00066 extern struct utmpx *pututxline (__const struct utmpx *__utmpx) __THROW;
00067 
00068 
00069 #ifdef __USE_GNU
00070 /* Change name of the utmpx file to be examined.  */
00071 extern int utmpxname (__const char *__file) __THROW;
00072 
00073 /* Append entry UTMP to the wtmpx-like file WTMPX_FILE.  */
00074 extern void updwtmpx (__const char *__wtmpx_file,
00075                     __const struct utmpx *__utmpx) __THROW;
00076 
00077 
00078 /* Copy the information in UTMPX to UTMP. */
00079 extern void getutmp (__const struct utmpx *__utmpx,
00080                    struct utmp *__utmp) __THROW;
00081 
00082 /* Copy the information in UTMP to UTMPX. */
00083 extern void getutmpx (__const struct utmp *__utmp,
00084                     struct utmpx *__utmpx) __THROW;
00085 #endif
00086 
00087 __END_DECLS
00088 
00089 #endif /* utmpx.h  */