skalibs

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

iopause_stamp.c (391B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/tai.h>
      5 #include <skalibs/iopause.h>
      6 
      7 int iopause_stamp (iopause_fd *x, unsigned int n, tain const *deadline, tain *stamp)
      8 {
      9   int r ;
     10   do
     11   {
     12     r = iopause(x, n, deadline, stamp) ;
     13     if (stamp)
     14     {
     15       int e = errno ;
     16       tain_now(stamp) ;
     17       errno = e ;
     18     }
     19   }
     20   while ((r < 0) && (errno == EINTR)) ;
     21   return r ;
     22 }