home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
LIBSRC.ZOO
/
libsrc
/
local
/
close.c
< prev
next >
Wrap
Text File
|
1992-02-16
|
500b
|
35 lines
#define INCL_DOSFILEMGR
#define INCL_DOSERRORS
#include <os2.h>
#include <errno.h>
ULONG Dos32Close() asm ("Dos32Close");
int close (int fd)
{
ULONG rc;
rc = Dos32Close (fd);
if (rc)
{
if (rc == ERROR_INVALID_HANDLE)
{
errno = EBADF;
return (-1);
}
if (rc == ERROR_ACCESS_DENIED)
{
errno = EACCES;
return (-1);
}
errno = EIO;
return (-1);
}
return (0);
}