home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 2.ddi / CLIBSRC3.ZIP / DOSCMMIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.3 KB  |  46 lines

  1. /*---------------------------------------------------------------------------
  2.  * filename - doscommit.c
  3.  *
  4.  * function(s)
  5.  *        _dos_commit - commit a file handle
  6.  *--------------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1991, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <_io.h>
  18. #include <dos.h>
  19.  
  20. /*--------------------------------------------------------------------------*
  21.  
  22. Name            _dos_commit - commit a file handle
  23.  
  24. Usage           unsigned _dos_commit(int handle);
  25.  
  26. Prototype in    io.h
  27.  
  28. Description     _dos_commit commits the  file handle indicated by handle which is
  29.                 obtained  from a  _dos_creat, _dos_creatnew, or _dos_open call.
  30.  
  31. Return value    Upon successful completion, _dos_commit returns 0.
  32.                 Otherwise, the DOS error code is returned, and errno is set to
  33.                         EBADF   Bad file number
  34.  
  35. *---------------------------------------------------------------------------*/
  36. unsigned _dos_commit( int fd )
  37. {
  38.     _AH = 0x68;
  39.     _BX = fd;
  40.     geninterrupt(0x21);
  41.     if (_FLAGS & 1)                     /* if carry set, error */
  42.         return (__DOSerror(_AX));       /* set errno */
  43.     else
  44.         return (0);
  45. }
  46.