Fortify ppoll64.
I've deliberately not bothered with the GCC implementation because we'll
have removed GCC from the NDK before anyone gets to use this.
Bug: http://b/72493232
Test: ran tests
Change-Id: Icfc2a3b214739ab53aa41bacacc11b5c67498fb4
diff --git a/tests/fortify_test.cpp b/tests/fortify_test.cpp
index 67c124d..b5b858f 100644
--- a/tests/fortify_test.cpp
+++ b/tests/fortify_test.cpp
@@ -995,7 +995,18 @@
// Set timeout to zero to prevent waiting in ppoll when fortify test fails.
timespec timeout;
timeout.tv_sec = timeout.tv_nsec = 0;
- ASSERT_FORTIFY(ppoll(buf, fd_count, &timeout, NULL));
+ ASSERT_FORTIFY(ppoll(buf, fd_count, &timeout, nullptr));
+}
+
+TEST_F(DEATHTEST, ppoll64_fortified) {
+#if __BIONIC__ // glibc doesn't have ppoll64.
+ nfds_t fd_count = atoi("2"); // suppress compiler optimizations
+ pollfd buf[1] = {{0, POLLIN, 0}};
+ // Set timeout to zero to prevent waiting in ppoll when fortify test fails.
+ timespec timeout;
+ timeout.tv_sec = timeout.tv_nsec = 0;
+ ASSERT_FORTIFY(ppoll64(buf, fd_count, &timeout, nullptr));
+#endif
}
TEST_F(DEATHTEST, open_O_CREAT_without_mode_fortified) {