Correct more fortify availability guards.
Test: make checkbuild
Bug: http://b/30465923
Change-Id: I90ac222483ecd39f1e7cc358babfb64e305cffcb
diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h
index 0f454b0..5a8a81d 100644
--- a/libc/include/sys/select.h
+++ b/libc/include/sys/select.h
@@ -61,7 +61,7 @@
void __FD_SET_chk(int, fd_set*, size_t) __INTRODUCED_IN(21);
int __FD_ISSET_chk(int, fd_set*, size_t) __INTRODUCED_IN(21);
-#if defined(__BIONIC_FORTIFY)
+#if defined(__BIONIC_FORTIFY) && __ANDROID_API__ >= 21
#define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set))
#define FD_SET(fd, set) __FD_SET_chk(fd, set, __bos(set))
#define FD_ISSET(fd, set) __FD_ISSET_chk(fd, set, __bos(set))
@@ -69,7 +69,7 @@
#define FD_CLR(fd, set) (__FDS_BITS(set)[__FDELT(fd)] &= ~__FDMASK(fd))
#define FD_SET(fd, set) (__FDS_BITS(set)[__FDELT(fd)] |= __FDMASK(fd))
#define FD_ISSET(fd, set) ((__FDS_BITS(set)[__FDELT(fd)] & __FDMASK(fd)) != 0)
-#endif /* defined(__BIONIC_FORTIFY) */
+#endif /* defined(__BIONIC_FORTIFY) && __ANDROID_API >= 21 */
int select(int, fd_set*, fd_set*, fd_set*, struct timeval*);
int pselect(int, fd_set*, fd_set*, fd_set*, const struct timespec*, const sigset_t*);
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index ac7d4c2..ab8108a 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -489,6 +489,7 @@
}
#endif /* __ANDROID_API__ >= 24 */
+#if __ANDROID_API__ >= 23
__BIONIC_FORTIFY_INLINE
ssize_t readlink(const char* path, char* buf, size_t size) {
size_t bos = __bos(buf);
@@ -538,6 +539,7 @@
return __readlinkat_chk(dirfd, path, buf, size, bos);
}
+#endif /* __ANDROID_API__ >= 23 */
#endif /* defined(__BIONIC_FORTIFY) */