\r
/* mostly windows-specific */\r
#ifndef CMSG_SPACE\r
-typedef struct {\r
+struct cmsghdr{\r
unsigned int cmsg_len;\r
int cmsg_level;\r
int cmsg_type;\r
+ unsigned char cmsg_data[16]; /* dummy */\r
/* followed by UCHAR cmsg_data[]; */\r
-} cmsghdr;\r
+} ;\r
\r
/* lifted off https://metacpan.org/source/SAMPO/Socket-PassAccessRights-0.03/passfd.c */\r
#ifndef CMSG_DATA\r
\r
#ifndef CMSG_FIRSTHDR\r
# define CMSG_FIRSTHDR(mhdr) \\r
- ((size_t) (mhdr)->msg_controllen >= sizeof ( cmsghdr) \\r
- ? ( cmsghdr *) (mhdr)->msg_control : ( cmsghdr *) NULL)\r
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \\r
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)\r
#endif\r
\r
#ifndef CMSG_ALIGN\r
\r
#ifndef CMSG_SPACE\r
# define CMSG_SPACE(len) (CMSG_ALIGN (len) \\r
- + CMSG_ALIGN (sizeof ( cmsghdr)))\r
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))\r
#endif\r
\r
#ifndef CMSG_LEN\r
-# define CMSG_LEN(len) (CMSG_ALIGN (sizeof ( cmsghdr)) + (len))\r
+# define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))\r
#endif\r
\r
struct msghdr {\r
\r
\r
struct iovec {\r
-\r
+ void *iov_base;\r
+ size_t iov_len;\r
};\r
struct sockaddr_un {\r
- char sun_path[256]; /* pathname */\r
+ char sun_family;\r
+ char sun_path[256]; /* pathname */\r
};\r
+# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \\r
+ + strlen ((ptr)->sun_path))\r
+\r
\r
#endif /* CMSG_SPACE */\r
\r
+#ifndef SCM_RIGHTS\r
+#define SCM_RIGHTS 1\r
+#endif\r
+#ifndef SCM_CREDENTIALS\r
+#define SCM_CREDENTIALS 2\r
+#endif\r
+#ifndef SCM_SECURITY\r
+#define SCM_SECURITY 3\r
+#endif\r
+\r
+#ifndef AF_LOCAL\r
+#define AF_LOCAL 1\r
+#endif\r
+\r
#endif /* CMSG_H_ */\r