home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / unixlib36d / UnixLib36d / src / unix / c / unlink < prev    next >
Encoding:
Text File  |  1994-03-08  |  417 b   |  30 lines

  1. static char sccs_id[] = "@(#) unlink.c 1.2 " __DATE__ " HJR";
  2.  
  3. /* unlink.c (c) Copyright 1990 H.Rogers */
  4.  
  5. #include <errno.h>
  6.  
  7. #include "sys/unix.h"
  8. #include "sys/os.h"
  9.  
  10. int
  11. unlink (char *file)
  12. {
  13.   os_error *e;
  14.  
  15.   file = __uname (file, 0);
  16.   if (!*file)
  17.     {
  18.       errno = ENOENT;
  19.       return (-1);
  20.     }
  21.  
  22.   if (e = os_fsctrl (27, file, 0, 0642))
  23.     {
  24.       __seterr (e);
  25.       return (-1);
  26.     }
  27.  
  28.   return (0);
  29. }
  30.