bglibs
cmsg.h
1#ifndef BGLIBS__NET__CMSG__H__
2#define BGLIBS__NET__CMSG__H__
3
4#ifdef SOLARIS
5#define _XOPEN_SOURCE 500
6#endif
7
8#include <sys/socket.h>
9
10#ifndef MSG_NOSIGNAL
11#define MSG_NOSIGNAL 0
12#endif
13
14#ifndef CMSG_ALIGN
15#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
16 & (size_t) ~(sizeof (size_t) - 1))
17#endif
18
19#ifndef CMSG_SPACE
20#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
21#endif
22
23#ifndef CMSG_LEN
24#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
25#endif
26
27#endif