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