summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2016-05-03 14:43:21 +0200
committerAndreas Schneider <asn@samba.org>2016-05-03 15:36:06 +0200
commit09f3be725259c8ea9f51c84a96c4c03459ba72aa (patch)
tree439bc3c02276be40d7cc8a36b96b48fb3714fe26
parentfeb9ee05b08eebbac21bab8ad9dd00beb96d4981 (diff)
downloadsocket_wrapper-09f3be725259c8ea9f51c84a96c4c03459ba72aa.tar.gz
socket_wrapper-09f3be725259c8ea9f51c84a96c4c03459ba72aa.tar.xz
socket_wrapper-09f3be725259c8ea9f51c84a96c4c03459ba72aa.zip
swrap: Add support for running on OpenBSD
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
-rw-r--r--ConfigureChecks.cmake2
-rw-r--r--config.h.cmake1
-rw-r--r--src/socket_wrapper.c10
3 files changed, 13 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 71e5056..5e96912 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -63,6 +63,8 @@ check_function_exists(eventfd HAVE_EVENTFD)
check_function_exists(timerfd_create HAVE_TIMERFD_CREATE)
check_function_exists(bindresvport HAVE_BINDRESVPORT)
+check_function_exists(pledge HAVE_PLEDGE)
+
if (UNIX)
if (NOT LINUX)
diff --git a/config.h.cmake b/config.h.cmake
index 91e1206..40347f9 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -39,6 +39,7 @@
#cmakedefine HAVE_EVENTFD 1
#cmakedefine HAVE_TIMERFD_CREATE 1
#cmakedefine HAVE_BINDRESVPORT 1
+#cmakedefine HAVE_PLEDGE 1
#cmakedefine HAVE_ACCEPT_PSOCKLEN_T 1
#cmakedefine HAVE_IOCTL_INT 1
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 3b0499d..f78c896 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -5248,6 +5248,16 @@ int eventfd(int count, int flags)
}
#endif
+#ifdef HAVE_PLEDGE
+int pledge(const char *promises, const char *paths[])
+{
+ (void)promises; /* unused */
+ (void)paths; /* unused */
+
+ return 0;
+}
+#endif /* HAVE_PLEDGE */
+
/****************************
* DESTRUCTOR
***************************/