summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/connect.c
blob: 51eee43050eeb2b63819bbca6c9b2a3a39ac4f3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <mlvalues.h>
#include "unix.h"

#ifdef HAS_SOCKETS

#include "socketaddr.h"

value unix_connect(socket, address)   /* ML */
     value socket, address;
{
  get_sockaddr(address);
  if (connect(Int_val(socket), &sock_addr.s_gen, sock_addr_len) == -1)
    uerror("connect", Nothing);
  return Val_unit;
}

#else

value unix_connect() { invalid_argument("connect not implemented"); }
  
#endif