home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / dos / compat / d_setftm.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  656 b   |  32 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. /*
  3.  * D_SETFTM.C.
  4.  *
  5.  * Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
  6.  *
  7.  * This file is distributed WITHOUT ANY WARRANTY; without even the implied
  8.  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9.  *
  10.  */
  11.  
  12. #include <dpmi.h>
  13. #include <errno.h>
  14. #include <dos.h>
  15.  
  16. unsigned int _dos_setftime(int handle, unsigned int date, unsigned int time)
  17. {
  18.   __dpmi_regs r;
  19.  
  20.   r.x.ax = 0x5701;
  21.   r.x.bx = handle;
  22.   r.x.cx = time;
  23.   r.x.dx = date;
  24.   __dpmi_int(0x21, &r);
  25.   if ( r.x.flags & 1 )
  26.   {
  27.     errno = EBADF;
  28.     return r.x.ax;
  29.   }
  30.   return 0;
  31. }
  32.