home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 May
/
W2KPRK.iso
/
apps
/
posix
/
source
/
SH
/
STD
/
POSIX
/
FCNTL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1999-11-17
|
430b
|
29 lines
/* fcntl emulation */
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#if _V7
#include <sgtty.h>
int
fcntl(fd, cmd, arg)
int fd, cmd, arg;
{
switch (cmd) {
case F_SETFD: /* set fd flags */
ioctl(fd, (arg&FD_CLEXEC) ? FIOCLEX : FIONCLEX, (char *)NULL);
break;
case F_DUPFD: /* dup fd */
/* this one is fun. find an unused fd >= arg and dup2 */
break;
}
return 0;
}
#endif