home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / pwd / pwent.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-26  |  340 b   |  29 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <pwd.h>
  3. #include <unistd.h>
  4.  
  5. static int count=0;
  6.  
  7. void
  8. setpwent(void)
  9. {
  10.   count=0;
  11. }
  12.  
  13. struct passwd *
  14. getpwent(void)
  15. {
  16.   if (count == 0)
  17.   {
  18.     count++;
  19.     return getpwuid(getuid());
  20.   }
  21.   return 0;
  22. }
  23.  
  24. void
  25. endpwent(void)
  26. {
  27.   count=0;
  28. }
  29.