skalibs

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

socket_deadlineconnstamp46.c (428B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 
      5 #include <skalibs/error.h>
      6 #include <skalibs/socket.h>
      7 #include <skalibs/ip46.h>
      8 
      9 int socket_deadlineconnstamp46 (int s, ip46 const *i, uint16_t port, tain const *deadline, tain *stamp)
     10 {
     11   int e = errno ;
     12   if (socket_connect46(s, i, port) >= 0) return 1 ;
     13   if (!error_isagain(errno) && !error_isalready(errno)) return 0 ;
     14   errno = e ;
     15   return socket_waitconn(s, deadline, stamp) ;
     16 }