aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-07-13 03:55:52 +0000
committerrsc <devnull@localhost>2005-07-13 03:55:52 +0000
commit2ec48bbca32b5483b746cac1f2e6121171e33544 (patch)
tree2fea3b6eb5dce8af2adfd395d95781cda6dd477d
parent835c1e4786bf14ca8a6b17d8538f8881f55ae764 (diff)
downloadplan9port-2ec48bbca32b5483b746cac1f2e6121171e33544.tar.gz
plan9port-2ec48bbca32b5483b746cac1f2e6121171e33544.tar.bz2
plan9port-2ec48bbca32b5483b746cac1f2e6121171e33544.zip
align macros for sun
-rw-r--r--src/lib9/sendfd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib9/sendfd.c b/src/lib9/sendfd.c
index 6f1154a5..23741e78 100644
--- a/src/lib9/sendfd.c
+++ b/src/lib9/sendfd.c
@@ -6,6 +6,22 @@
#include <unistd.h>
#include <errno.h>
+#ifndef CMSG_ALIGN
+# ifdef __sun__
+# define CMSG_ALIGN _CMSG_DATA_ALIGN
+# else
+# define CMSG_ALIGN(len) (((len)+sizeof(long)-1) & ~(sizeof(long)-1))
+# endif
+#endif
+
+#ifndef CMSG_SPACE
+# define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+CMSG_ALIGN(len))
+#endif
+
+#ifndef CMSG_LEN
+# define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len))
+#endif
+
int
sendfd(int s, int fd)
{