home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1350 / setpwent.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  353 b   |  24 lines

  1. /*
  2.  *      setpwent.c: Rewind password file to beginning for getpwent()
  3.  *
  4.  *      Stephen C. Trier
  5.  *      March 26, 1990
  6.  *
  7.  *      This program is in the public domain
  8.  *
  9.  */
  10.  
  11. #include <stdio.h>
  12. #include <pwd.h>
  13.  
  14. extern FILE *_pw_file;
  15.  
  16. int setpwent(void)
  17. {
  18.     if (_pw_file == NULL)
  19.     pw_openfile(NULL);
  20.     return fseek(_pw_file, 0L, SEEK_SET);
  21. }
  22.  
  23.  
  24.