mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Overhaul process spawning
This commit is contained in:
parent
99dc1281f5
commit
26e254fb4d
96 changed files with 1848 additions and 1541 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/log/check.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
@ -69,7 +70,10 @@ TEST(dup, bigNumber) {
|
|||
|
||||
#ifdef __x86_64__
|
||||
TEST(dup, clearsCloexecFlag) {
|
||||
static bool once;
|
||||
int ws;
|
||||
ASSERT_FALSE(once);
|
||||
once = true;
|
||||
ASSERT_SYS(0, 0, close(creat("file", 0644)));
|
||||
ASSERT_SYS(0, 3, open("file", O_RDWR | O_CLOEXEC));
|
||||
ASSERT_NE(-1, (ws = xspawn(0)));
|
||||
|
@ -79,7 +83,7 @@ TEST(dup, clearsCloexecFlag) {
|
|||
(char *const[]){GetProgramExecutableName(), "boop", 0});
|
||||
_exit(127);
|
||||
}
|
||||
ASSERT_EQ(72, WEXITSTATUS(ws));
|
||||
ASSERT_EQ(72 << 8, ws);
|
||||
ASSERT_SYS(0, 0, close(3));
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue