home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / unistd / rmdir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-31  |  543 b   |  31 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <libc/stubs.h>
  3. #include <errno.h>
  4. #include <unistd.h>
  5. #include <fcntl.h>
  6. #include <go32.h>
  7. #include <dpmi.h>
  8. #include <libc/dosio.h>
  9.  
  10. int
  11. rmdir(const char *dirname)
  12. {
  13.   __dpmi_regs r;
  14.  
  15.   if(_USE_LFN)
  16.     r.x.ax = 0x713a;
  17.   else
  18.     r.h.ah = 0x3a;
  19.   r.x.ds = __tb_segment;
  20.   r.x.dx = __tb_offset;
  21.   _put_path(dirname);
  22.   __dpmi_int(0x21, &r);
  23.  
  24.   if (r.x.flags & 1)
  25.   {
  26.     errno = __doserr_to_errno(r.x.ax);
  27.     return -1;
  28.   }
  29.   return 0;
  30. }
  31.