Prepare headers to support file descriptor passing over UNIX Domain Sockets.

Contributed by Thomas Cort.
This commit is contained in:
Thomas Veerman
2010-08-30 13:41:22 +00:00
parent a0bb199f69
commit 2297e26660
6 changed files with 54 additions and 12 deletions

View File

@@ -45,7 +45,10 @@ sys/socket.h
typedef uint8_t sa_family_t;
#endif /* _SA_FAMILY_T */
#ifndef _SOCKLEN_T
#define _SOCKLEN_T
typedef int32_t socklen_t;
#endif /* _SOCKLEN_T */
struct sockaddr
{
@@ -94,6 +97,12 @@ struct cmsghdr
#define CMSG_DATA(cmsg) \
( (unsigned char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr)) )
#define CMSG_SPACE(len) \
( CMSG_ALIGN(len) + CMSG_ALIGN(sizeof(struct cmsghdr)) )
#define CMSG_LEN(len) \
( len + CMSG_ALIGN(sizeof(struct cmsghdr)) )
#define SCM_RIGHTS 0x01
#define SCM_CREDENTIALS 0x02
#define SCM_SECURITY 0x04