From 09f3be725259c8ea9f51c84a96c4c03459ba72aa Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 3 May 2016 14:43:21 +0200 Subject: swrap: Add support for running on OpenBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Schneider Reviewed-by: Ralph Böhme --- ConfigureChecks.cmake | 2 ++ config.h.cmake | 1 + src/socket_wrapper.c | 10 ++++++++++ 3 files changed, 13 insertions(+) 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 ***************************/ -- cgit