1 #ifndef PLEDGE_H 2 #define PLEDGE_H 3 4 #ifdef __OpenBSD__ 5 6 #ifndef _BSD_SOURCE 7 #define _BSD_SOURCE 8 #endif 9 10 #include <err.h> 11 #include <unistd.h> 12 13 static void xpledge(const char * promises,const char * execpromises)14xpledge(const char *promises, const char *execpromises) 15 { 16 if (pledge(promises, execpromises) == -1) 17 err(1, "pledge"); 18 } 19 20 #else 21 22 #define xpledge(promises, execpromises) do { } while(0) 23 24 #endif /* __OpenBSD__ */ 25 26 #endif /* PLEDGE_H */ 27