forked from jackokring/rub
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathunixsocketsh.inc
33 lines (27 loc) · 909 Bytes
/
unixsocketsh.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const
clib = 'c';
type
Pmsghdr = ^msghdr;
msghdr = record
msg_name : pointer;
msg_namelen : socklen_t;
msg_iov : piovec;
msg_iovlen : size_t;
msg_control : pointer;
msg_controllen : socklen_t;
msg_flags : cInt;
end;
Pcmsghdr = ^cmsghdr;
cmsghdr = record
cmsg_len : socklen_t;
cmsg_level : cInt;
cmsg_type : cInt;
end;
function sendmsg(__fd: cInt; __message: pmsghdr; __flags: cInt): ssize_t; cdecl; external clib name 'sendmsg';
function recvmsg(__fd: cInt; __message: pmsghdr; __flags: cInt): ssize_t; cdecl; external clib name 'recvmsg';
function CMSG_FIRSTHDR(mhdr: Pmsghdr): Pcmsghdr;
function CMSG_NXTHDR(mhdr: Pmsghdr; cmsg: Pcmsghdr): Pcmsghdr;
function CMSG_ALIGN(len: size_t): size_t;
function CMSG_SPACE(len: size_t): size_t;
function CMSG_LEN(len: size_t): size_t;
function CMSG_DATA(cmsg : pcmsghdr) : Pbyte;