Skip to content

Commit fa930b0

Browse files
committed
test: add test for getsid_test.cpp to check for failing getsid syscall
This commit also do cleanup on libc/src/unistd/linux/CMakeLists.txt to remove unnecessary fnctl_macros and unistd from add_entrypoint_object for getsid Signed-off-by: ZakyHermawan <[email protected]>
1 parent a9878c1 commit fa930b0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libc/src/unistd/linux/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ add_entrypoint_object(
243243
../getsid.h
244244
DEPENDS
245245
libc.hdr.types.pid_t
246-
libc.hdr.fcntl_macros
247-
libc.include.unistd
248246
libc.include.sys_syscall
249247
libc.src.__support.OSUtil.osutil
250248
libc.src.errno.errno

libc/test/src/unistd/getsid_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ TEST(LlvmLibcGetPidTest, GetCurrSID) {
1414
pid_t sid = LIBC_NAMESPACE::getsid(0);
1515
ASSERT_NE(sid, -1);
1616
ASSERT_ERRNO_SUCCESS();
17+
18+
pid_t nonexist_sid = LIBC_NAMESPACE::getsid(999999);
19+
ASSERT_EQ(nonexist_sid, -1);
20+
ASSERT_ERRNO_FAILURE();
1721
}

0 commit comments

Comments
 (0)