Overhaul process spawning

This commit is contained in:
Justine Tunney 2023-09-10 08:12:43 -07:00
parent 99dc1281f5
commit 26e254fb4d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
96 changed files with 1848 additions and 1541 deletions

View file

@ -57,6 +57,17 @@ TEST(write, badMemory_efault) {
ASSERT_SYS(EFAULT, -1, write(1, (void *)1, 1));
}
TEST(write, brokenPipe_raisesSigpipe) {
int fds[2];
SPAWN(fork);
signal(SIGPIPE, SIG_DFL);
ASSERT_SYS(0, 0, pipe(fds));
ASSERT_SYS(0, 1, write(4, "x", 1));
ASSERT_SYS(0, 0, close(3));
write(4, "x", 1);
TERMS(SIGPIPE);
}
TEST(write, brokenPipe_sigpipeIgnored_returnsEpipe) {
int fds[2];
SPAWN(fork);