home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / apps / posix / source / SH / STD / POSIX / FCNTL.C < prev    next >
C/C++ Source or Header  |  1999-11-17  |  430b  |  29 lines

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