home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
CLOSE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
418b
|
28 lines
/*
* close(): close a file. written by Eric R. Smith and placed in the public
* domain
*/
#include <osbind.h>
#include <fcntl.h>
#include <errno.h>
int
close(fd)
int fd;
{
int r;
r = Fclose(fd);
if (r < 0) {
errno = -r;
return -1;
}
fd = __OPEN_INDEX(fd);
if (fd >= 0 && fd < __NHANDLES) {
__open_stat[fd].status = FH_UNKNOWN;
__open_stat[fd].flags = 0;
}
return 0;
}