aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-05-25 15:30:17 +0200
committerMattias Andrée <maandree@kth.se>2017-05-25 17:47:23 +0200
commit7b147cb0c1eaa728f244cc8390ccfcc3f4aee03a (patch)
tree80e23538c1d8b364ec9c8c7e58e895b9a471dfef /src/common.h
parentFix errors and warnings and make the code cleaner (diff)
downloadblind-7b147cb0c1eaa728f244cc8390ccfcc3f4aee03a.tar.gz
blind-7b147cb0c1eaa728f244cc8390ccfcc3f4aee03a.tar.bz2
blind-7b147cb0c1eaa728f244cc8390ccfcc3f4aee03a.tar.xz
Add blind-from-named and blind-to-named
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 3a746f8..3e3f966 100644
--- a/src/common.h
+++ b/src/common.h
@@ -20,7 +20,13 @@
# include <sys/epoll.h>
#endif
#include <sys/mman.h>
+#if defined(HAVE_SENDFILE)
+# include <sys/sendfile.h>
+#endif
#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <sys/un.h>
#include <sys/wait.h>
#include <alloca.h>
#include <ctype.h>
@@ -35,3 +41,19 @@
#include <string.h>
#include <strings.h>
#include <unistd.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