summaryrefslogtreecommitdiff
path: root/src/libstddjb/ipc_bind_reuse.c
blob: 31db745a656614847ff8d477fefd4617c4b1a177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <skalibs/nonposix.h>
#include <sys/socket.h>
#include <unistd.h>
#include <skalibs/webipc.h>

int ipc_bind_reuse (int s, char const *p)
{
  unsigned int opt = 1 ;
  setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof opt) ;
  unlink(p) ;
  return ipc_bind(s, p) ;
}