mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-09 19:30:29 +00:00
Include zipos test for vfork close sanity
This commit is contained in:
parent
469bfdaab9
commit
31044aaa3c
1 changed files with 13 additions and 0 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include "libc/str/str.h"
|
#include "libc/str/str.h"
|
||||||
#include "libc/sysv/consts/o.h"
|
#include "libc/sysv/consts/o.h"
|
||||||
#include "libc/testlib/hyperion.h"
|
#include "libc/testlib/hyperion.h"
|
||||||
|
#include "libc/testlib/subprocess.h"
|
||||||
#include "libc/testlib/testlib.h"
|
#include "libc/testlib/testlib.h"
|
||||||
#include "libc/thread/thread.h"
|
#include "libc/thread/thread.h"
|
||||||
|
|
||||||
|
@ -111,3 +112,15 @@ TEST(zipos, lseek) {
|
||||||
EXPECT_EQ(0, memcmp(b1, b2, 512));
|
EXPECT_EQ(0, memcmp(b1, b2, 512));
|
||||||
EXPECT_SYS(0, 0, close(3));
|
EXPECT_SYS(0, 0, close(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(zipos, closeAfterVfork) {
|
||||||
|
ASSERT_SYS(0, 3, open("/zip/libc/testlib/hyperion.txt", O_RDONLY));
|
||||||
|
SPAWN(vfork);
|
||||||
|
ASSERT_SYS(0, 0, close(3));
|
||||||
|
ASSERT_SYS(0, 3, open("/etc/hosts", O_RDONLY));
|
||||||
|
ASSERT_SYS(0, 0, close(3));
|
||||||
|
ASSERT_SYS(EBADF, -1, close(3));
|
||||||
|
EXITS(0);
|
||||||
|
ASSERT_SYS(0, 0, close(3));
|
||||||
|
ASSERT_SYS(EBADF, -1, close(3));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue