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

@@ -202,3 +202,17 @@ TEST(stdlib, strtof) {
TEST(stdlib, strtold) {
ASSERT_DOUBLE_EQ(1.23, strtold("1.23", NULL));
}
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));
}