Implement _Exit(3).

Change-Id: Ida6ac844cc87d38c9645b197dd8188bb73e27dbe
This commit is contained in:
Elliott Hughes
2014-04-08 17:14:01 -07:00
parent ac70d2e1fe
commit 9f525644df
10 changed files with 49 additions and 2 deletions

View File

@@ -116,3 +116,17 @@ TEST(unistd, read_EBADF) {
TEST(unistd, alarm) {
ASSERT_EQ(0U, alarm(0));
}
TEST(unistd, _exit) {
int pid = fork();
ASSERT_NE(-1, pid) << strerror(errno);
if (pid == 0) {
_exit(99);
}
int status;
ASSERT_EQ(pid, waitpid(pid, &status, 0));
ASSERT_TRUE(WIFEXITED(status));
ASSERT_EQ(99, WEXITSTATUS(status));
}