Guard fortify inlines with __ANDROID_API__.
Test: make checkbuild with libc ndk_library patches applied
Change-Id: Ic5e248994c4f2702b0f4d6dfeda787187ea86017
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index 40b9d37..223c3b2 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -300,6 +300,7 @@
#if defined(__BIONIC_FORTIFY)
+#if __ANDROID_API__ >= 24
__BIONIC_FORTIFY_INLINE
ssize_t recvfrom(int fd, void* buf, size_t len, int flags, const struct sockaddr* src_addr, socklen_t* addr_len) {
size_t bos = __bos0(buf);
@@ -320,6 +321,7 @@
return __recvfrom_chk(fd, buf, len, bos, flags, src_addr, addr_len);
}
+#endif /* __ANDROID_API__ >= 24 */
__BIONIC_FORTIFY_INLINE
ssize_t recv(int socket, void* buf, size_t len, int flags) {
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index 0d350e0..775fb08 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -163,6 +163,7 @@
#if defined(__BIONIC_FORTIFY)
+#if __ANDROID_API__ >= 18
__BIONIC_FORTIFY_INLINE
mode_t umask(mode_t mode) {
#if !defined(__clang__)
@@ -175,6 +176,8 @@
#endif
return __umask_chk(mode);
}
+#endif /* __ANDROID_API__ >= 18 */
+
#endif /* defined(__BIONIC_FORTIFY) */
#if __ANDROID_API__ >= 21