utmpx.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _UTMPX_H
  15. #define _UTMPX_H 1
  16. #include <features.h>
  17. #include <sys/time.h>
  18. /* Required according to Unix98. */
  19. #ifndef __pid_t_defined
  20. typedef __pid_t pid_t;
  21. # define __pid_t_defined
  22. #endif
  23. /* Get system dependent values and data structures. */
  24. #include <bits/utmpx.h>
  25. #ifdef __USE_GNU
  26. /* Compatibility names for the strings of the canonical file names. */
  27. # define UTMPX_FILE _PATH_UTMPX
  28. # define UTMPX_FILENAME _PATH_UTMPX
  29. # define WTMPX_FILE _PATH_WTMPX
  30. # define WTMPX_FILENAME _PATH_WTMPX
  31. #endif
  32. /* For the getutmp{,x} functions we need the `struct utmp'. */
  33. #ifdef __USE_GNU
  34. struct utmp;
  35. #endif
  36. __BEGIN_DECLS
  37. /* Open user accounting database.
  38. This function is a possible cancellation point and therefore not
  39. marked with __THROW. */
  40. extern void setutxent (void);
  41. /* Close user accounting database.
  42. This function is a possible cancellation point and therefore not
  43. marked with __THROW. */
  44. extern void endutxent (void);
  45. /* Get the next entry from the user accounting database.
  46. This function is a possible cancellation point and therefore not
  47. marked with __THROW. */
  48. extern struct utmpx *getutxent (void);
  49. /* Get the user accounting database entry corresponding to ID.
  50. This function is a possible cancellation point and therefore not
  51. marked with __THROW. */
  52. extern struct utmpx *getutxid (const struct utmpx *__id);
  53. /* Get the user accounting database entry corresponding to LINE.
  54. This function is a possible cancellation point and therefore not
  55. marked with __THROW. */
  56. extern struct utmpx *getutxline (const struct utmpx *__line);
  57. /* Write the entry UTMPX into the user accounting database.
  58. This function is a possible cancellation point and therefore not
  59. marked with __THROW. */
  60. extern struct utmpx *pututxline (const struct utmpx *__utmpx);
  61. #ifdef __USE_GNU
  62. /* Change name of the utmpx file to be examined.
  63. This function is not part of POSIX and therefore no official
  64. cancellation point. But due to similarity with an POSIX interface
  65. or due to the implementation it is a cancellation point and
  66. therefore not marked with __THROW. */
  67. extern int utmpxname (const char *__file);
  68. /* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
  69. This function is not part of POSIX and therefore no official
  70. cancellation point. But due to similarity with an POSIX interface
  71. or due to the implementation it is a cancellation point and
  72. therefore not marked with __THROW. */
  73. extern void updwtmpx (const char *__wtmpx_file,
  74. const struct utmpx *__utmpx);
  75. /* Copy the information in UTMPX to UTMP.
  76. This function is not part of POSIX and therefore no official
  77. cancellation point. But due to similarity with an POSIX interface
  78. or due to the implementation it is a cancellation point and
  79. therefore not marked with __THROW. */
  80. extern void getutmp (const struct utmpx *__utmpx,
  81. struct utmp *__utmp);
  82. /* Copy the information in UTMP to UTMPX.
  83. This function is not part of POSIX and therefore no official
  84. cancellation point. But due to similarity with an POSIX interface
  85. or due to the implementation it is a cancellation point and
  86. therefore not marked with __THROW. */
  87. extern void getutmpx (const struct utmp *__utmp,
  88. struct utmpx *__utmpx);
  89. #endif
  90. __END_DECLS
  91. #endif /* utmpx.h */