Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / runtime / basis / Net / Socket / GenericSock.c
CommitLineData
7f918cf1
CE
1#include "platform.h"
2
3C_Errno_t(C_Int_t)
4Socket_GenericSock_socket (C_Int_t domain, C_Int_t type, C_Int_t protocol) {
5 int out;
6
7 MLton_initSockets ();
8 out = socket (domain, type, protocol);
9 if (out == -1) MLton_fixSocketErrno ();
10
11 return out;
12}
13
14C_Errno_t(C_Int_t)
15Socket_GenericSock_socketPair (C_Int_t domain, C_Int_t type, C_Int_t protocol, Array(C_Int_t) sv) {
16 int out;
17
18 MLton_initSockets ();
19 out = socketpair (domain, type, protocol, (int*)sv);
20 if (out == -1) MLton_fixSocketErrno ();
21
22 return out;
23}