home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / pdksh-4.9-src.lha / GNU / src / amiga / pdksh-4.9 / std / posix / fcntl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-04  |  483 b   |  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.