From the manpage:
> exec: Allows a process to call execve(2). Coupled with the proc promise, this allows a process to fork and execute another program. The new program starts running without pledge active and hopefully makes a new pledge().
> exec: Allows a process to call execve(2). Coupled with the proc promise, this allows a process to fork and execute another program. The new program starts running without pledge active and hopefully makes a new pledge().
$ cat testpledge.c
#include <unistd.h>
#include <stdio.h>
int main()
{
pledge("proc exec", NULL);
execl("/bin/echo", "echo", "asdf", NULL);
_exit(0);
}
$ cc testpledge.c
$ ./a.out
asdf