Fixup API level guards for new fortify functions.
Test: tools/update_headers.sh && make checkbuild
Bug: None
Change-Id: I9d06ea8a5ee9dc27d957f59e6e84150651ed1c76
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 7c6125a..017d97a 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -403,6 +403,7 @@
}
#endif /* __ANDROID_API__ >= __ANDROID_API_N__ */
+#if __ANDROID_API__ >= __ANDROID_API_L__
__BIONIC_ERROR_FUNCTION_VISIBILITY
ssize_t read(int fd, void* buf, size_t count) __overloadable
__error_if_overflows_ssizet(count);
@@ -423,7 +424,9 @@
return __read_chk(fd, buf, count, bos);
}
+#endif /* __ANDROID_API__ >= __ANDROID_API_L__ */
+#if __ANDROID_API__ >= __ANDROID_API_N__
__BIONIC_ERROR_FUNCTION_VISIBILITY
ssize_t write(int fd, const void* buf, size_t count) __overloadable
__error_if_overflows_ssizet(count);
@@ -444,7 +447,9 @@
return __write_chk(fd, buf, count, bos);
}
+#endif /* __ANDROID_API__ >= __ANDROID_API_N__ */
+#if __ANDROID_API__ >= __ANDROID_API_M__
__BIONIC_ERROR_FUNCTION_VISIBILITY
ssize_t readlink(const char* path, char* buf, size_t size) __overloadable
__error_if_overflows_ssizet(size);
@@ -466,7 +471,6 @@
return __readlink_chk(path, buf, size, bos);
}
-
__BIONIC_ERROR_FUNCTION_VISIBILITY
ssize_t readlinkat(int dirfd, const char* path, char* buf, size_t size)
__overloadable
@@ -490,6 +494,7 @@
return __readlinkat_chk(dirfd, path, buf, size, bos);
}
+#endif /* __ANDROID_API__ >= __ANDROID_API_M__ */
#undef __enable_if_no_overflow_ssizet
#undef __error_if_overflows_objectsize