mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Add more apis to redbean unix module
- Document unix.fcntl() - Add POSIX Advisory Locks - Add mask parameter to unix.poll() - Add lowest parameter to unix.dup()
This commit is contained in:
parent
ce588dd56b
commit
a1aaf23dc1
16 changed files with 432 additions and 102 deletions
13
third_party/make/posixos.c
vendored
13
third_party/make/posixos.c
vendored
|
@ -16,6 +16,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||
|
||||
#include "third_party/make/makeint.inc"
|
||||
/**/
|
||||
#include "libc/sock/select.h"
|
||||
#include "libc/sysv/consts/f.h"
|
||||
#include "libc/sysv/consts/fd.h"
|
||||
#include "libc/sysv/consts/sa.h"
|
||||
|
@ -231,18 +232,16 @@ unsigned int jobserver_acquire(int timeout) {
|
|||
FD_SET(job_fds[0], &readfds);
|
||||
|
||||
r = pselect(job_fds[0] + 1, &readfds, NULL, NULL, specp, &empty);
|
||||
if (r < 0) switch (errno) {
|
||||
case EINTR:
|
||||
if (r < 0)
|
||||
{
|
||||
if (errno == EINTR)
|
||||
/* SIGCHLD will show up as an EINTR. */
|
||||
return 0;
|
||||
|
||||
case EBADF:
|
||||
if (errno == EBADF)
|
||||
/* Someone closed the jobs pipe.
|
||||
That shouldn't happen but if it does we're done. */
|
||||
O(fatal, NILF, _("job server shut down"));
|
||||
|
||||
default:
|
||||
pfatal_with_name(_("pselect jobs pipe"));
|
||||
pfatal_with_name(_("pselect jobs pipe"));
|
||||
}
|
||||
|
||||
if (r == 0) /* Timeout. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue