Remove the always-true __INTRODUCED_IN() annotations.
The NDK no longer supports API levels earlier than 21.
This *doesn't* include <ctype.h> because I have a separate change
rewriting that (that's blocked on the upcoming libc++ update).
Test: treehugger
Change-Id: I53e915f27011dfc0513e0c78d8799377e183ceca
diff --git a/libc/include/sys/auxv.h b/libc/include/sys/auxv.h
index bf70dda..b664e2a 100644
--- a/libc/include/sys/auxv.h
+++ b/libc/include/sys/auxv.h
@@ -45,9 +45,7 @@
*
* Returns the corresponding value on success,
* and returns 0 and sets `errno` to `ENOENT` on failure.
- *
- * Available since API level 18.
*/
-unsigned long int getauxval(unsigned long int __type) __INTRODUCED_IN(18);
+unsigned long int getauxval(unsigned long int __type);
__END_DECLS
diff --git a/libc/include/sys/endian.h b/libc/include/sys/endian.h
index 9155b4c..1c7448c 100644
--- a/libc/include/sys/endian.h
+++ b/libc/include/sys/endian.h
@@ -49,10 +49,10 @@
/* glibc compatibility. */
__BEGIN_DECLS
-uint32_t htonl(uint32_t __x) __attribute_const__ __INTRODUCED_IN(21);
-uint16_t htons(uint16_t __x) __attribute_const__ __INTRODUCED_IN(21);
-uint32_t ntohl(uint32_t __x) __attribute_const__ __INTRODUCED_IN(21);
-uint16_t ntohs(uint16_t __x) __attribute_const__ __INTRODUCED_IN(21);
+uint32_t htonl(uint32_t __x) __attribute_const__;
+uint16_t htons(uint16_t __x) __attribute_const__;
+uint32_t ntohl(uint32_t __x) __attribute_const__;
+uint16_t ntohs(uint16_t __x) __attribute_const__;
__END_DECLS
#define htonl(x) __swap32(x)
diff --git a/libc/include/sys/epoll.h b/libc/include/sys/epoll.h
index 9e09408..2091b90 100644
--- a/libc/include/sys/epoll.h
+++ b/libc/include/sys/epoll.h
@@ -38,11 +38,11 @@
__BEGIN_DECLS
int epoll_create(int __size);
-int epoll_create1(int __flags) __INTRODUCED_IN(21);
+int epoll_create1(int __flags);
int epoll_ctl(int __epoll_fd, int __op, int __fd, struct epoll_event* __BIONIC_COMPLICATED_NULLNESS __event);
int epoll_wait(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms);
-int epoll_pwait(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms, const sigset_t* _Nullable __mask) __INTRODUCED_IN(21);
+int epoll_pwait(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms, const sigset_t* _Nullable __mask);
int epoll_pwait64(int __epoll_fd, struct epoll_event* _Nonnull __events, int __event_count, int __timeout_ms, const sigset64_t* _Nullable __mask) __INTRODUCED_IN(28);
__END_DECLS
diff --git a/libc/include/sys/fsuid.h b/libc/include/sys/fsuid.h
index c1c8ebb..273749f 100644
--- a/libc/include/sys/fsuid.h
+++ b/libc/include/sys/fsuid.h
@@ -43,19 +43,15 @@
* filesystem checks.
*
* Returns the previous UID.
- *
- * Available since API level 21.
*/
-int setfsuid(uid_t __uid) __INTRODUCED_IN(21);
+int setfsuid(uid_t __uid);
/**
* [setfsgid(2)](http://man7.org/linux/man-pages/man2/setfsgid.2.html) sets the GID used for
* filesystem checks.
*
* Returns the previous GID.
- *
- * Available since API level 21.
*/
-int setfsgid(gid_t __gid) __INTRODUCED_IN(21);
+int setfsgid(gid_t __gid);
__END_DECLS
diff --git a/libc/include/sys/inotify.h b/libc/include/sys/inotify.h
index e834d07..f070857 100644
--- a/libc/include/sys/inotify.h
+++ b/libc/include/sys/inotify.h
@@ -41,7 +41,7 @@
#define IN_NONBLOCK O_NONBLOCK
int inotify_init(void);
-int inotify_init1(int __flags) __INTRODUCED_IN(21);
+int inotify_init1(int __flags);
int inotify_add_watch(int __fd, const char* _Nonnull __path, uint32_t __mask);
int inotify_rm_watch(int __fd, uint32_t __watch_descriptor);
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index cbe6a75..f32ae61 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -59,10 +59,8 @@
* mmap64() is a variant of mmap() that takes a 64-bit offset even on LP32.
*
* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md
- *
- * Available since API level 21.
*/
-void* _Nonnull mmap64(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off64_t __offset) __INTRODUCED_IN(21);
+void* _Nonnull mmap64(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off64_t __offset);
/**
* [munmap(2)](http://man7.org/linux/man-pages/man2/munmap.2.html)
@@ -107,21 +105,17 @@
* [mlockall(2)](http://man7.org/linux/man-pages/man2/mlockall.2.html)
* locks pages (preventing swapping).
*
- * Available since API level 17.
- *
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mlockall(int __flags) __INTRODUCED_IN(17);
+int mlockall(int __flags);
/**
* [munlockall(2)](http://man7.org/linux/man-pages/man2/munlockall.2.html)
* unlocks pages (allowing swapping).
*
- * Available since API level 17.
- *
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int munlockall(void) __INTRODUCED_IN(17);
+int munlockall(void);
/**
* [mlock(2)](http://man7.org/linux/man-pages/man2/mlock.2.html)
diff --git a/libc/include/sys/resource.h b/libc/include/sys/resource.h
index 0b540de..6743343 100644
--- a/libc/include/sys/resource.h
+++ b/libc/include/sys/resource.h
@@ -46,8 +46,8 @@
int getrlimit(int __resource, struct rlimit* _Nonnull __limit);
int setrlimit(int __resource, const struct rlimit* _Nonnull __limit);
-int getrlimit64(int __resource, struct rlimit64* _Nonnull __limit) __INTRODUCED_IN(21);
-int setrlimit64(int __resource, const struct rlimit64* _Nonnull __limit) __INTRODUCED_IN(21);
+int getrlimit64(int __resource, struct rlimit64* _Nonnull __limit);
+int setrlimit64(int __resource, const struct rlimit64* _Nonnull __limit);
int getpriority(int __which, id_t __who);
int setpriority(int __which, id_t __who, int __priority);
@@ -55,7 +55,7 @@
int getrusage(int __who, struct rusage* _Nonnull __usage);
int prlimit(pid_t __pid, int __resource, const struct rlimit* _Nullable __new_limit, struct rlimit* _Nullable __old_limit) __INTRODUCED_IN_32(24) __INTRODUCED_IN_64(21);
-int prlimit64(pid_t __pid, int __resource, const struct rlimit64* _Nullable __new_limit, struct rlimit64* _Nullable __old_limit) __INTRODUCED_IN(21);
+int prlimit64(pid_t __pid, int __resource, const struct rlimit64* _Nullable __new_limit, struct rlimit64* _Nullable __old_limit);
__END_DECLS
diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h
index 8c6c2ff..84c2621 100644
--- a/libc/include/sys/select.h
+++ b/libc/include/sys/select.h
@@ -71,9 +71,9 @@
} \
} while (0)
-void __FD_CLR_chk(int, fd_set* _Nonnull , size_t) __INTRODUCED_IN(21);
-void __FD_SET_chk(int, fd_set* _Nonnull, size_t) __INTRODUCED_IN(21);
-int __FD_ISSET_chk(int, const fd_set* _Nonnull, size_t) __INTRODUCED_IN(21);
+void __FD_CLR_chk(int, fd_set* _Nonnull , size_t);
+void __FD_SET_chk(int, fd_set* _Nonnull, size_t);
+int __FD_ISSET_chk(int, const fd_set* _Nonnull, size_t);
#define __FD_CLR(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] &= ~__FDMASK(fd))
#define __FD_SET(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] |= __FDMASK(fd))
diff --git a/libc/include/sys/sendfile.h b/libc/include/sys/sendfile.h
index 4b00d5d..e1a34d2 100644
--- a/libc/include/sys/sendfile.h
+++ b/libc/include/sys/sendfile.h
@@ -40,15 +40,13 @@
/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */
#if defined(__USE_FILE_OFFSET64)
-ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64) __INTRODUCED_IN(21);
+ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64);
#else
/**
* [sendfile(2)](http://man7.org/linux/man-pages/man2/sendfile.2.html) copies data directly
* between two file descriptors.
*
* Returns the number of bytes copied on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 21.
*/
ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count);
#endif
@@ -57,6 +55,6 @@
* Like sendfile() but allows using a 64-bit offset
* even from a 32-bit process without `__FILE_OFFSET_BITS=64`.
*/
-ssize_t sendfile64(int __out_fd, int __in_fd, off64_t* _Nullable __offset, size_t __count) __INTRODUCED_IN(21);
+ssize_t sendfile64(int __out_fd, int __in_fd, off64_t* _Nullable __offset, size_t __count);
__END_DECLS
diff --git a/libc/include/sys/signalfd.h b/libc/include/sys/signalfd.h
index f669cc8..2be9bdc 100644
--- a/libc/include/sys/signalfd.h
+++ b/libc/include/sys/signalfd.h
@@ -45,10 +45,8 @@
* file descriptor for reading signal events.
*
* Returns the file descriptor on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 18.
*/
-int signalfd(int __fd, const sigset_t* _Nonnull __mask, int __flags) __INTRODUCED_IN(18);
+int signalfd(int __fd, const sigset_t* _Nonnull __mask, int __flags);
/**
* Like signalfd() but allows setting a signal mask with RT signals even from a 32-bit process.
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index 821c483..22b88cb 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -120,7 +120,7 @@
? (struct cmsghdr*) (msg)->msg_control : (struct cmsghdr*) NULL)
#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && (cmsg)->cmsg_len <= (unsigned long) ((mhdr)->msg_controllen - ((char*)(cmsg) - (char*)(mhdr)->msg_control)))
-struct cmsghdr* _Nullable __cmsg_nxthdr(struct msghdr* _Nonnull __msg, struct cmsghdr* _Nonnull __cmsg) __INTRODUCED_IN(21);
+struct cmsghdr* _Nullable __cmsg_nxthdr(struct msghdr* _Nonnull __msg, struct cmsghdr* _Nonnull __cmsg);
#define SCM_RIGHTS 0x01
#define SCM_CREDENTIALS 0x02
@@ -292,17 +292,16 @@
#endif
__socketcall int accept(int __fd, struct sockaddr* _Nullable __addr, socklen_t* _Nullable __addr_length);
-__socketcall int accept4(int __fd, struct sockaddr* _Nullable __addr, socklen_t* _Nullable __addr_length, int __flags) __INTRODUCED_IN(21);
+__socketcall int accept4(int __fd, struct sockaddr* _Nullable __addr, socklen_t* _Nullable __addr_length, int __flags);
__socketcall int bind(int __fd, const struct sockaddr* _Nonnull __addr, socklen_t __addr_length);
__socketcall int connect(int __fd, const struct sockaddr* _Nonnull __addr, socklen_t __addr_length);
__socketcall int getpeername(int __fd, struct sockaddr* _Nonnull __addr, socklen_t* _Nonnull __addr_length);
__socketcall int getsockname(int __fd, struct sockaddr* _Nonnull __addr, socklen_t* _Nonnull __addr_length);
__socketcall int getsockopt(int __fd, int __level, int __option, void* _Nullable __value, socklen_t* _Nonnull __value_length);
__socketcall int listen(int __fd, int __backlog);
-__socketcall int recvmmsg(int __fd, struct mmsghdr* _Nonnull __msgs, unsigned int __msg_count, int __flags, const struct timespec* _Nullable __timeout)
- __INTRODUCED_IN(21);
+__socketcall int recvmmsg(int __fd, struct mmsghdr* _Nonnull __msgs, unsigned int __msg_count, int __flags, const struct timespec* _Nullable __timeout);
__socketcall ssize_t recvmsg(int __fd, struct msghdr* _Nonnull __msg, int __flags);
-__socketcall int sendmmsg(int __fd, const struct mmsghdr* _Nonnull __msgs, unsigned int __msg_count, int __flags) __INTRODUCED_IN(21);
+__socketcall int sendmmsg(int __fd, const struct mmsghdr* _Nonnull __msgs, unsigned int __msg_count, int __flags);
__socketcall ssize_t sendmsg(int __fd, const struct msghdr* _Nonnull __msg, int __flags);
__socketcall int setsockopt(int __fd, int __level, int __option, const void* _Nullable __value, socklen_t __value_length);
__socketcall int shutdown(int __fd, int __how);
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index f773ff6..f916573 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -141,13 +141,13 @@
int mkdir(const char* _Nonnull __path, mode_t __mode);
int fstat(int __fd, struct stat* _Nonnull __buf);
-int fstat64(int __fd, struct stat64* _Nonnull __buf) __INTRODUCED_IN(21);
+int fstat64(int __fd, struct stat64* _Nonnull __buf);
int fstatat(int __dir_fd, const char* _Nonnull __path, struct stat* _Nonnull __buf, int __flags);
-int fstatat64(int __dir_fd, const char* _Nonnull __path, struct stat64* _Nonnull __buf, int __flags) __INTRODUCED_IN(21);
+int fstatat64(int __dir_fd, const char* _Nonnull __path, struct stat64* _Nonnull __buf, int __flags);
int lstat(const char* _Nonnull __path, struct stat* _Nonnull __buf);
-int lstat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf) __INTRODUCED_IN(21);
+int lstat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf);
int stat(const char* _Nonnull __path, struct stat* _Nonnull __buf);
-int stat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf) __INTRODUCED_IN(21);
+int stat64(const char* _Nonnull __path, struct stat64* _Nonnull __buf);
int mknod(const char* _Nonnull __path, mode_t __mode, dev_t __dev);
mode_t umask(mode_t __mask);
@@ -156,12 +156,12 @@
#include <bits/fortify/stat.h>
#endif
-int mkfifo(const char* _Nonnull __path, mode_t __mode) __INTRODUCED_IN(21);
+int mkfifo(const char* _Nonnull __path, mode_t __mode);
int mkfifoat(int __dir_fd, const char* _Nonnull __path, mode_t __mode) __INTRODUCED_IN(23);
int fchmodat(int __dir_fd, const char* _Nonnull __path, mode_t __mode, int __flags);
int mkdirat(int __dir_fd, const char* _Nonnull __path, mode_t __mode);
-int mknodat(int __dir_fd, const char* _Nonnull __path, mode_t __mode, dev_t __dev) __INTRODUCED_IN(21);
+int mknodat(int __dir_fd, const char* _Nonnull __path, mode_t __mode, dev_t __dev);
/**
* Used in the tv_nsec field of an argument to utimensat()/futimens()
@@ -200,10 +200,8 @@
* See also UTIME_NOW and UTIME_OMIT.
*
* Returns 0 on success and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int futimens(int __fd, const struct timespec __times[_Nullable 2]) __INTRODUCED_IN(19);
+int futimens(int __fd, const struct timespec __times[_Nullable 2]);
#if defined(__USE_GNU)
/**
diff --git a/libc/include/sys/statvfs.h b/libc/include/sys/statvfs.h
index d81f836..46fbea5 100644
--- a/libc/include/sys/statvfs.h
+++ b/libc/include/sys/statvfs.h
@@ -93,25 +93,21 @@
* queries filesystem statistics for the given path.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int statvfs(const char* _Nonnull __path, struct statvfs* _Nonnull __buf) __INTRODUCED_IN(19);
+int statvfs(const char* _Nonnull __path, struct statvfs* _Nonnull __buf);
/**
* [fstatvfs(3)](http://man7.org/linux/man-pages/man3/fstatvfs.3.html)
* queries filesystem statistics for the given file descriptor.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int fstatvfs(int __fd, struct statvfs* _Nonnull __buf) __INTRODUCED_IN(19);
+int fstatvfs(int __fd, struct statvfs* _Nonnull __buf);
/** Equivalent to statvfs() . */
-int statvfs64(const char* _Nonnull __path, struct statvfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int statvfs64(const char* _Nonnull __path, struct statvfs64* _Nonnull __buf);
/** Equivalent to fstatvfs(). */
-int fstatvfs64(int __fd, struct statvfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int fstatvfs64(int __fd, struct statvfs64* _Nonnull __buf);
__END_DECLS
diff --git a/libc/include/sys/swap.h b/libc/include/sys/swap.h
index 9d016d4..474aed7 100644
--- a/libc/include/sys/swap.h
+++ b/libc/include/sys/swap.h
@@ -55,18 +55,14 @@
* [swapon(2)](http://man7.org/linux/man-pages/man2/swapon.2.html) enables swapping.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int swapon(const char* _Nonnull __path, int __flags) __INTRODUCED_IN(19);
+int swapon(const char* _Nonnull __path, int __flags);
/**
* [swapoff(2)](http://man7.org/linux/man-pages/man2/swapoff.2.html) disables swapping.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int swapoff(const char* _Nonnull __path) __INTRODUCED_IN(19);
+int swapoff(const char* _Nonnull __path);
__END_DECLS
diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index 06b2188..dc869da 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -66,8 +66,7 @@
*
* This method is for inspecting and debugging the property system, and not generally useful.
*/
-int __system_property_foreach(void (* _Nonnull __callback)(const prop_info* _Nonnull __pi, void* _Nullable __cookie), void* _Nullable __cookie)
- __INTRODUCED_IN(19);
+int __system_property_foreach(void (* _Nonnull __callback)(const prop_info* _Nonnull __pi, void* _Nullable __cookie), void* _Nullable __cookie);
/*
* Waits for the specific system property identified by `pi` to be updated
diff --git a/libc/include/sys/timerfd.h b/libc/include/sys/timerfd.h
index aafcef2..de1f55b 100644
--- a/libc/include/sys/timerfd.h
+++ b/libc/include/sys/timerfd.h
@@ -50,10 +50,8 @@
* timer file descriptor.
*
* Returns the new file descriptor on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int timerfd_create(clockid_t __clock, int __flags) __INTRODUCED_IN(19);
+int timerfd_create(clockid_t __clock, int __flags);
/** The timerfd_settime() flag to use absolute rather than relative times. */
#define TFD_TIMER_ABSTIME (1 << 0)
@@ -65,19 +63,15 @@
* stops a timer.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int timerfd_settime(int __fd, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value) __INTRODUCED_IN(19);
+int timerfd_settime(int __fd, int __flags, const struct itimerspec* _Nonnull __new_value, struct itimerspec* _Nullable __old_value);
/**
* [timerfd_gettime(2)](http://man7.org/linux/man-pages/man2/timerfd_gettime.2.html) queries the
* current timer settings.
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
- *
- * Available since API level 19.
*/
-int timerfd_gettime(int __fd, struct itimerspec* _Nonnull __current_value) __INTRODUCED_IN(19);
+int timerfd_gettime(int __fd, struct itimerspec* _Nonnull __current_value);
__END_DECLS
diff --git a/libc/include/sys/vfs.h b/libc/include/sys/vfs.h
index 18ae428..3579799 100644
--- a/libc/include/sys/vfs.h
+++ b/libc/include/sys/vfs.h
@@ -105,9 +105,9 @@
#define XFS_SUPER_MAGIC 0x58465342
int statfs(const char* _Nonnull __path, struct statfs* _Nonnull __buf);
-int statfs64(const char* _Nonnull __path, struct statfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int statfs64(const char* _Nonnull __path, struct statfs64* _Nonnull __buf);
int fstatfs(int __fd, struct statfs* _Nonnull __buf);
-int fstatfs64(int __fd, struct statfs64* _Nonnull __buf) __INTRODUCED_IN(21);
+int fstatfs64(int __fd, struct statfs64* _Nonnull __buf);
__END_DECLS
diff --git a/libc/include/sys/wait.h b/libc/include/sys/wait.h
index e6fb855..5208366 100644
--- a/libc/include/sys/wait.h
+++ b/libc/include/sys/wait.h
@@ -39,7 +39,7 @@
pid_t wait(int* _Nullable __status);
pid_t waitpid(pid_t __pid, int* _Nullable __status, int __options);
-pid_t wait4(pid_t __pid, int* _Nullable __status, int __options, struct rusage* _Nullable __rusage) __INTRODUCED_IN(18);
+pid_t wait4(pid_t __pid, int* _Nullable __status, int __options, struct rusage* _Nullable __rusage);
/* Posix states that idtype_t should be an enumeration type, but
* the kernel headers define P_ALL, P_PID and P_PGID as constant macros