home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / pdksh-4.9-src.tgz / tar.out / contrib / pdksh / std / posix / fcntl.c < prev    next >
C/C++ Source or Header  |  1996-09-28  |  483b  |  30 lines

  1. /* fcntl emulation */
  2. /* $Id: fcntl.c,v 1.3 93/05/05 21:17:45 sjg Exp $ */
  3.  
  4. #include <errno.h>
  5. #include <sys/types.h>
  6. #include <unistd.h>
  7. #include <fcntl.h>
  8.  
  9. #if _V7
  10.  
  11. #include <sgtty.h>
  12.  
  13. int
  14. fcntl(fd, cmd, arg)
  15.     int fd, cmd, arg;
  16. {
  17.     switch (cmd) {
  18.       case F_SETFD:        /* set fd flags */
  19.         ioctl(fd, (arg&FD_CLEXEC) ? FIOCLEX : FIONCLEX, (char *)NULL);
  20.         break;
  21.       case F_DUPFD:        /* dup fd */
  22.         /* this one is fun. find an unused fd >= arg and dup2 */
  23.         break;
  24.     }
  25.     return 0;
  26. }
  27.  
  28. #endif
  29.  
  30.