Back to index

glibc  2.9
utmpx.h
Go to the documentation of this file.
00001 /* Copyright (C) 1997, 1998, 1999, 2003 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 
00052    This function is a possible cancellation point and therefore not
00053    marked with __THROW.  */
00054 extern void setutxent (void);
00055 
00056 /* Close user accounting database.
00057 
00058    This function is a possible cancellation point and therefore not
00059    marked with __THROW.  */
00060 extern void endutxent (void);
00061 
00062 /* Get the next entry from the user accounting database.
00063 
00064    This function is a possible cancellation point and therefore not
00065    marked with __THROW.  */
00066 extern struct utmpx *getutxent (void);
00067 
00068 /* Get the user accounting database entry corresponding to ID.
00069 
00070    This function is a possible cancellation point and therefore not
00071    marked with __THROW.  */
00072 extern struct utmpx *getutxid (__const struct utmpx *__id);
00073 
00074 /* Get the user accounting database entry corresponding to LINE.
00075 
00076    This function is a possible cancellation point and therefore not
00077    marked with __THROW.  */
00078 extern struct utmpx *getutxline (__const struct utmpx *__line);
00079 
00080 /* Write the entry UTMPX into the user accounting database.
00081 
00082    This function is a possible cancellation point and therefore not
00083    marked with __THROW.  */
00084 extern struct utmpx *pututxline (__const struct utmpx *__utmpx);
00085 
00086 
00087 #ifdef __USE_GNU
00088 /* Change name of the utmpx file to be examined.
00089 
00090    This function is not part of POSIX and therefore no official
00091    cancellation point.  But due to similarity with an POSIX interface
00092    or due to the implementation it is a cancellation point and
00093    therefore not marked with __THROW.  */
00094 extern int utmpxname (__const char *__file);
00095 
00096 /* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
00097 
00098    This function is not part of POSIX and therefore no official
00099    cancellation point.  But due to similarity with an POSIX interface
00100    or due to the implementation it is a cancellation point and
00101    therefore not marked with __THROW.  */
00102 extern void updwtmpx (__const char *__wtmpx_file,
00103                     __const struct utmpx *__utmpx);
00104 
00105 
00106 /* Copy the information in UTMPX to UTMP.
00107 
00108    This function is not part of POSIX and therefore no official
00109    cancellation point.  But due to similarity with an POSIX interface
00110    or due to the implementation it is a cancellation point and
00111    therefore not marked with __THROW.  */
00112 extern void getutmp (__const struct utmpx *__utmpx,
00113                    struct utmp *__utmp);
00114 
00115 /* Copy the information in UTMP to UTMPX.
00116 
00117    This function is not part of POSIX and therefore no official
00118    cancellation point.  But due to similarity with an POSIX interface
00119    or due to the implementation it is a cancellation point and
00120    therefore not marked with __THROW.  */
00121 extern void getutmpx (__const struct utmp *__utmp,
00122                     struct utmpx *__utmpx);
00123 #endif
00124 
00125 __END_DECLS
00126 
00127 #endif /* utmpx.h  */