home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Serving the Web
/
ServingTheWeb1995.disc1of1.iso
/
linux
/
slacksrce
/
d
/
libc
/
libc-4.6
/
libc-4
/
libc-linux
/
dirent
/
closedir.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1992-10-12
|
308 b
|
23 lines
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#include <syscall.h>
static inline
_syscall1(int,close,int,fd)
int closedir(DIR * dir)
{
int fd;
if (!dir) {
errno = EBADF;
return -1;
}
fd = dir->dd_fd;
free(dir->dd_buf);
free(dir);
return close(fd);
}