Strengthen the pledge() polyfill

This commit is contained in:
Justine Tunney 2022-06-27 13:01:58 -07:00
parent a6f65eea7c
commit 3c92adfd6e
79 changed files with 1457 additions and 357 deletions

View file

@ -22,12 +22,14 @@
#include "libc/sysv/consts/af.h"
/**
* Creates bidirectional pipe.
* Creates bidirectional pipe, e.g.
*
* int sv[2];
* socketpair(AF_UNIX, SOCK_STREAM, 0, sv);
*
* @param family should be AF_UNIX or synonymously AF_LOCAL
* @param type can be SOCK_STREAM (for TCP), SOCK_DGRAM (e.g. UDP), or
* SOCK_RAW (IP) so long as IP_HDRINCL was passed to setsockopt();
* and additionally, may be or'd with SOCK_NONBLOCK, SOCK_CLOEXEC
* @param type can be SOCK_STREAM or SOCK_DGRAM and additionally,
* may be or'd with SOCK_NONBLOCK, SOCK_CLOEXEC
* @param sv a vector of 2 integers to store the created sockets
* @return 0 if success, -1 in case of error
* @error EFAULT, EPFNOSUPPORT, etc.