You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mblaze/xpledge.h

27 lines
389 B
C

#ifndef PLEDGE_H
#define PLEDGE_H
#ifdef __OpenBSD__
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif
#include <err.h>
#include <unistd.h>
static void
xpledge(const char *promises, const char *execpromises)
{
if (pledge(promises, execpromises) == -1)
err(1, "pledge");
}
#else
#define xpledge(promises, execpromises) do { } while(0)
#endif /* __OpenBSD__ */
#endif /* PLEDGE_H */