socket_recvnb46.c (654B)
1 /* ISC license. */ 2 3 #include <skalibs/socket.h> 4 #include <skalibs/ip46.h> 5 6 #ifdef SKALIBS_IPV6_ENABLED 7 8 ssize_t socket_recvnb46 (int s, char *buf, size_t len, ip46 *ip, uint16_t *port, int h, tain const *deadline, tain *stamp) 9 { 10 ssize_t r = h ? socket_recvnb6(s, buf, len, ip->ip, port, deadline, stamp) : socket_recvnb4(s, buf, len, ip->ip, port, deadline, stamp) ; 11 if (r == -1) return -1 ; 12 ip->is6 = !!h ; 13 return r ; 14 } 15 16 #else 17 18 ssize_t socket_recvnb46 (int s, char *buf, size_t len, ip46 *ip, uint16_t *port, int h, tain const *deadline, tain *stamp) 19 { 20 (void)h ; 21 return socket_recvnb4(s, buf, len, ip->ip, port, deadline, stamp) ; 22 } 23 24 #endif