libc fortify: make poll.h and stat.h use diagnose_if
Bug: 12231437
Test: m checkbuild on bionic internal master; CtsBionicTestCases show
no new failures.
Change-Id: I7dbdeca12c46d1ee3804f13546b11c3f3b3a7596
diff --git a/tests/fortify_compilation_test.cpp b/tests/fortify_compilation_test.cpp
index 51074b2..785b424 100644
--- a/tests/fortify_compilation_test.cpp
+++ b/tests/fortify_compilation_test.cpp
@@ -190,8 +190,8 @@
void test_umask() {
// NOLINTNEXTLINE(whitespace/line_length)
- // GCC: error: call to '__umask_invalid_mode' declared with attribute error: umask called with invalid mode
- // CLANG: error: call to unavailable function 'umask': umask called with invalid mode
+ // GCC: error: call to '__umask_invalid_mode' declared with attribute error: 'umask' called with invalid mode
+ // CLANG: error: 'umask' called with invalid mode
umask(01777);
}
@@ -219,7 +219,7 @@
pollfd fds[1];
// NOLINTNEXTLINE(whitespace/line_length)
// GCC: error: call to '__poll_too_small_error' declared with attribute error: poll: pollfd array smaller than fd count
- // CLANG: error: call to unavailable function 'poll': too many fds specified
+ // CLANG: error: in call to 'poll', fd_count is larger than the given buffer
poll(fds, 2, 0);
}
@@ -228,7 +228,7 @@
timespec timeout;
// NOLINTNEXTLINE(whitespace/line_length)
// GCC: error: call to '__ppoll_too_small_error' declared with attribute error: ppoll: pollfd array smaller than fd count
- // CLANG: error: call to unavailable function 'ppoll': too many fds specified
+ // CLANG: error: in call to 'ppoll', fd_count is larger than the given buffer
ppoll(fds, 2, &timeout, NULL);
}