skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

uncoe.c (234B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/fcntl.h>
      4 #include <skalibs/djbunix.h>
      5 
      6 int uncoe (int fd)
      7 {
      8   int flags = fcntl(fd, F_GETFD, 0) ;
      9   return flags < 0 ? flags : flags & FD_CLOEXEC ? fcntl(fd, F_SETFD, flags & ~FD_CLOEXEC) : 0 ;
     10 }