3
0

pwd_.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* vi: set sw=4 ts=4: */
  2. /* Copyright (C) 1991,92,95,96,97,98,99,2001 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. /*
  17. * POSIX Standard: 9.2.2 User Database Access <pwd.h>
  18. */
  19. #ifndef BB_PWD_H
  20. #define BB_PWD_H 1
  21. PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
  22. /* This file is #included after #include <pwd.h>
  23. * We will use libc-defined structures, but will #define function names
  24. * so that function calls are directed to bb_internal_XXX replacements
  25. */
  26. #undef endpwent
  27. #define setpwent bb_internal_setpwent
  28. #define endpwent bb_internal_endpwent
  29. #define getpwent bb_internal_getpwent
  30. #define getpwuid bb_internal_getpwuid
  31. #define getpwnam bb_internal_getpwnam
  32. #define getpwnam_r bb_internal_getpwnam_r
  33. /* All function names below should be remapped by #defines above
  34. * in order to not collide with libc names. */
  35. /* Rewind the password-file stream. */
  36. void FAST_FUNC setpwent(void);
  37. /* Close the password-file stream. */
  38. void FAST_FUNC endpwent(void);
  39. /* Read an entry from the password-file stream, opening it if necessary. */
  40. struct passwd* FAST_FUNC getpwent(void);
  41. /* Search for an entry with a matching user ID. */
  42. struct passwd* FAST_FUNC getpwuid(uid_t __uid);
  43. /* Search for an entry with a matching username. */
  44. struct passwd* FAST_FUNC getpwnam(const char *__name);
  45. /* Reentrant versions of some of the functions above. */
  46. int FAST_FUNC getpwnam_r(const char *__restrict __name,
  47. struct passwd *__restrict __resultbuf,
  48. char *__restrict __buffer, size_t __buflen,
  49. struct passwd **__restrict __result);
  50. POP_SAVED_FUNCTION_VISIBILITY
  51. #endif