From e7dc81cfad72bcf963eb9947d9bba21172281afe Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Fri, 14 Oct 2022 19:11:45 +0100 Subject: [PATCH] Forward-declare pledge() and unveil() on OpenBSD These are declared in unistd.h, but since _POSIX_SOURCE is defined they are not visible. Conditionally duplicating the declarations here seems less likely to bite me in the ass later on than making a bunch of other BSD-specific things visible. --- main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.c b/main.c index a06a3f0..6835e5a 100644 --- a/main.c +++ b/main.c @@ -31,6 +31,11 @@ #include #include +#ifdef __OpenBSD__ +int pledge(const char *, const char *); +int unveil(const char *, const char *); +#endif + #define HOST "::1" #define PORT 7070