home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume22 / auth-utils / part01 / util / rewind.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-29  |  320 b   |  18 lines

  1. /* rewind version 1.0, 4/20/90. */
  2.  
  3. #include <sys/file.h>
  4. #include <stdio.h>
  5.  
  6. main(argc,argv)
  7. int argc;
  8. char *argv[];
  9. {
  10.  int fd;
  11.  
  12.  if ((argc != 2) || (sscanf(argv[1],"%d",&fd) < 1))
  13.    { fputs("Usage: rewind fd\n",stderr); exit(1); }
  14.  if (lseek(fd,0,0))
  15.    { perror("rewind: fatal: cannot seek"); exit(2); }
  16.  exit(0);
  17. }
  18.