swrap: Add support for running on OpenBSD
authorAndreas Schneider <asn@samba.org>
Tue, 3 May 2016 12:43:21 +0000 (14:43 +0200)
committerAndreas Schneider <asn@samba.org>
Tue, 3 May 2016 13:36:06 +0000 (15:36 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
ConfigureChecks.cmake
config.h.cmake
src/socket_wrapper.c

index 71e50567e2630dd21e54a666d203cdaf41395403..5e96912618b7a3fc28ed70f99dfff99e3a509f0a 100644 (file)
@@ -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)
index 91e1206300ae3de2f5180f6f9979782413587a6f..40347f98927934237dbff63381051905c0d764d5 100644 (file)
@@ -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
index 3b0499d1756c19cba4388359e50874592a812b06..f78c8968918109eccd0a735d24d842f363739813 100644 (file)
@@ -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
  ***************************/