diff options
author | Jing Chen <chjing@google.com> | 2020-12-03 19:55:20 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-03 19:57:51 -0800 |
commit | a78cef0ed7ce15583424f5873f0aa6fdad1d5c2f (patch) | |
tree | c6a09e9fbbbbaea63f68bde1a9ef0a698a7b7ae3 /test | |
parent | 9eb77281c4fe1c1f252a0df67ca2c1fee8867b80 (diff) |
Implement command IPC_INFO for semctl.
PiperOrigin-RevId: 345589628
Diffstat (limited to 'test')
-rw-r--r-- | test/syscalls/linux/semaphore.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/syscalls/linux/semaphore.cc b/test/syscalls/linux/semaphore.cc index 890f4a246..1c1bf6a57 100644 --- a/test/syscalls/linux/semaphore.cc +++ b/test/syscalls/linux/semaphore.cc @@ -773,6 +773,21 @@ TEST(SemaphoreTest, SemopGetncntOnSignal_NoRandomSave) { EXPECT_EQ(semctl(sem.get(), 0, GETNCNT), 0); } +TEST(SemaphoreTest, IpcInfo) { + struct seminfo info; + ASSERT_THAT(semctl(0, 0, IPC_INFO, &info), SyscallSucceeds()); + + EXPECT_EQ(info.semmap, 1024000000); + EXPECT_EQ(info.semmni, 32000); + EXPECT_EQ(info.semmns, 1024000000); + EXPECT_EQ(info.semmnu, 1024000000); + EXPECT_EQ(info.semmsl, 32000); + EXPECT_EQ(info.semopm, 500); + EXPECT_EQ(info.semume, 500); + EXPECT_EQ(info.semvmx, 32767); + EXPECT_EQ(info.semaem, 32767); +} + } // namespace } // namespace testing } // namespace gvisor |