skalibs

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

socket_bind4r.c (308B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/nonposix.h>
      4 
      5 #include <sys/socket.h>
      6 
      7 #include <skalibs/socket.h>
      8 
      9 int socket_bind4_reuse (int s, char const *ip, uint16_t port)
     10 {
     11   static unsigned int const opt = 1 ;
     12   setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof opt) ;
     13   return socket_bind4(s, ip, port) ;
     14 }