utmpx.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* Copyright (C) 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _UTMPX_H
  16. #define _UTMPX_H 1
  17. #include <features.h>
  18. #include <sys/time.h>
  19. /* Required according to Unix98. */
  20. #ifndef __pid_t_defined
  21. typedef __pid_t pid_t;
  22. # define __pid_t_defined
  23. #endif
  24. /* Get system dependent values and data structures. */
  25. #include <bits/utmpx.h>
  26. #ifdef __USE_GNU
  27. /* Compatibility names for the strings of the canonical file names. */
  28. # define UTMPX_FILE _PATH_UTMPX
  29. # define UTMPX_FILENAME _PATH_UTMPX
  30. # define WTMPX_FILE _PATH_WTMPX
  31. # define WTMPX_FILENAME _PATH_WTMPX
  32. #endif
  33. /* For the getutmp{,x} functions we need the `struct utmp'. */
  34. #ifdef __USE_GNU
  35. struct utmp;
  36. #endif
  37. __BEGIN_DECLS
  38. /* Open user accounting database.
  39. This function is a possible cancellation point and therefore not
  40. marked with __THROW. */
  41. extern void setutxent (void);
  42. /* Close user accounting database.
  43. This function is a possible cancellation point and therefore not
  44. marked with __THROW. */
  45. extern void endutxent (void);
  46. /* Get the next entry from the user accounting database.
  47. This function is a possible cancellation point and therefore not
  48. marked with __THROW. */
  49. extern struct utmpx *getutxent (void);
  50. /* Get the user accounting database entry corresponding to ID.
  51. This function is a possible cancellation point and therefore not
  52. marked with __THROW. */
  53. extern struct utmpx *getutxid (__const struct utmpx *__id);
  54. /* Get the user accounting database entry corresponding to LINE.
  55. This function is a possible cancellation point and therefore not
  56. marked with __THROW. */
  57. extern struct utmpx *getutxline (__const struct utmpx *__line);
  58. /* Write the entry UTMPX into the user accounting database.
  59. This function is a possible cancellation point and therefore not
  60. marked with __THROW. */
  61. extern struct utmpx *pututxline (__const struct utmpx *__utmpx);
  62. #ifdef __USE_GNU
  63. /* Change name of the utmpx file to be examined.
  64. This function is not part of POSIX and therefore no official
  65. cancellation point. But due to similarity with an POSIX interface
  66. or due to the implementation it is a cancellation point and
  67. therefore not marked with __THROW. */
  68. extern int utmpxname (__const char *__file);
  69. /* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
  70. This function is not part of POSIX and therefore no official
  71. cancellation point. But due to similarity with an POSIX interface
  72. or due to the implementation it is a cancellation point and
  73. therefore not marked with __THROW. */
  74. extern void updwtmpx (__const char *__wtmpx_file,
  75. __const struct utmpx *__utmpx);
  76. /* Copy the information in UTMPX to UTMP.
  77. This function is not part of POSIX and therefore no official
  78. cancellation point. But due to similarity with an POSIX interface
  79. or due to the implementation it is a cancellation point and
  80. therefore not marked with __THROW. */
  81. extern void getutmp (__const struct utmpx *__utmpx,
  82. struct utmp *__utmp);
  83. /* Copy the information in UTMP to UTMPX.
  84. This function is not part of POSIX and therefore no official
  85. cancellation point. But due to similarity with an POSIX interface
  86. or due to the implementation it is a cancellation point and
  87. therefore not marked with __THROW. */
  88. extern void getutmpx (__const struct utmp *__utmp,
  89. struct utmpx *__utmpx);
  90. #endif
  91. __END_DECLS
  92. #endif /* utmpx.h */