skalibs

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

fd_chmod.c (325B)


      1 /* ISC license. */
      2 
      3  /* OpenBSD manages to bork the fchmod declaration */
      4 #include <skalibs/nonposix.h>
      5 #include <sys/stat.h>
      6 #include <errno.h>
      7 #include <skalibs/djbunix.h>
      8 
      9 int fd_chmod (int fd, unsigned int mode)
     10 {
     11   int r ;
     12   do
     13     r = fchmod(fd, (mode_t)mode) ;
     14   while ((r == -1) && (errno == EINTR)) ;
     15   return r ;
     16 }