aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-18 01:05:56 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-18 01:05:56 +0000
commit094259da4c2a28e6693fdb18085afb6aa9659751 (patch)
tree99b0bee8706c1d0755b49839a8475af1ca5f1135
parent83dcec35ce68fbc9d5afa124a0344259c0a79fe4 (diff)
parent704e8a8984bcbfea7e45c95ffc79aeff9315db6d (diff)
downloadbionic-094259da4c2a28e6693fdb18085afb6aa9659751.tar.gz
Snap for 9957928 from 704e8a8984bcbfea7e45c95ffc79aeff9315db6d to udc-release
Change-Id: I9fef5282a43e26b218385142becf05162223e9f8
-rw-r--r--libc/include/sys/inotify.h2
-rw-r--r--libc/include/sys/mount.h6
-rw-r--r--libc/include/sys/msg.h6
-rw-r--r--libc/include/sys/wait.h8
-rw-r--r--tests/sys_msg_test.cpp6
5 files changed, 17 insertions, 11 deletions
diff --git a/libc/include/sys/inotify.h b/libc/include/sys/inotify.h
index c3cdc8556..e834d0774 100644
--- a/libc/include/sys/inotify.h
+++ b/libc/include/sys/inotify.h
@@ -42,7 +42,7 @@ __BEGIN_DECLS
int inotify_init(void);
int inotify_init1(int __flags) __INTRODUCED_IN(21);
-int inotify_add_watch(int __fd, const char* __path, uint32_t __mask);
+int inotify_add_watch(int __fd, const char* _Nonnull __path, uint32_t __mask);
int inotify_rm_watch(int __fd, uint32_t __watch_descriptor);
__END_DECLS
diff --git a/libc/include/sys/mount.h b/libc/include/sys/mount.h
index 4db1ac1a6..aace205a9 100644
--- a/libc/include/sys/mount.h
+++ b/libc/include/sys/mount.h
@@ -55,7 +55,7 @@ __BEGIN_DECLS
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int mount(const char* __source, const char* __target, const char* __fs_type, unsigned long __flags, const void* __data);
+int mount(const char* __BIONIC_COMPLICATED_NULLNESS __source, const char* _Nonnull __target, const char* __BIONIC_COMPLICATED_NULLNESS __fs_type, unsigned long __flags, const void* _Nullable __data);
/**
* [umount(2)](http://man7.org/linux/man-pages/man2/umount.2.html) unmounts the filesystem at
@@ -63,7 +63,7 @@ int mount(const char* __source, const char* __target, const char* __fs_type, uns
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int umount(const char* __target);
+int umount(const char* _Nonnull __target);
/**
* [umount2(2)](http://man7.org/linux/man-pages/man2/umount2.2.html) unmounts the filesystem at
@@ -71,6 +71,6 @@ int umount(const char* __target);
*
* Returns 0 on success, and returns -1 and sets `errno` on failure.
*/
-int umount2(const char* __target, int __flags);
+int umount2(const char* _Nonnull __target, int __flags);
__END_DECLS
diff --git a/libc/include/sys/msg.h b/libc/include/sys/msg.h
index e19452c4e..ad481a00b 100644
--- a/libc/include/sys/msg.h
+++ b/libc/include/sys/msg.h
@@ -46,12 +46,12 @@ typedef __kernel_ulong_t msgqnum_t;
typedef __kernel_ulong_t msglen_t;
/** Not useful on Android; disallowed by SELinux. */
-int msgctl(int __msg_id, int __cmd, struct msqid_ds* __buf) __INTRODUCED_IN(26);
+int msgctl(int __msg_id, int __cmd, struct msqid_ds* _Nullable __buf) __INTRODUCED_IN(26);
/** Not useful on Android; disallowed by SELinux. */
int msgget(key_t __key, int __flags) __INTRODUCED_IN(26);
/** Not useful on Android; disallowed by SELinux. */
-ssize_t msgrcv(int __msg_id, void* __msgbuf_ptr, size_t __size, long __type, int __flags) __INTRODUCED_IN(26);
+ssize_t msgrcv(int __msg_id, void* _Nonnull __msgbuf_ptr, size_t __size, long __type, int __flags) __INTRODUCED_IN(26);
/** Not useful on Android; disallowed by SELinux. */
-int msgsnd(int __msg_id, const void* __msgbuf_ptr, size_t __size, int __flags) __INTRODUCED_IN(26);
+int msgsnd(int __msg_id, const void* _Nonnull __msgbuf_ptr, size_t __size, int __flags) __INTRODUCED_IN(26);
__END_DECLS
diff --git a/libc/include/sys/wait.h b/libc/include/sys/wait.h
index 96974a25b..e6fb855db 100644
--- a/libc/include/sys/wait.h
+++ b/libc/include/sys/wait.h
@@ -37,9 +37,9 @@
__BEGIN_DECLS
-pid_t wait(int* __status);
-pid_t waitpid(pid_t __pid, int* __status, int __options);
-pid_t wait4(pid_t __pid, int* __status, int __options, struct rusage* __rusage) __INTRODUCED_IN(18);
+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);
/* 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
@@ -47,6 +47,6 @@ pid_t wait4(pid_t __pid, int* __status, int __options, struct rusage* __rusage)
*/
typedef int idtype_t;
-int waitid(idtype_t __type, id_t __id, siginfo_t* __info, int __options);
+int waitid(idtype_t __type, id_t __id, siginfo_t* _Nullable __info, int __options);
__END_DECLS
diff --git a/tests/sys_msg_test.cpp b/tests/sys_msg_test.cpp
index 200f65437..da45087f9 100644
--- a/tests/sys_msg_test.cpp
+++ b/tests/sys_msg_test.cpp
@@ -74,9 +74,12 @@ TEST(sys_msg, smoke) {
}
TEST(sys_msg, msgctl_failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
errno = 0;
ASSERT_EQ(-1, msgctl(-1, IPC_STAT, nullptr));
ASSERT_TRUE(errno == EINVAL || errno == ENOSYS);
+#pragma clang diagnostic pop
}
TEST(sys_msg, msgget_failure) {
@@ -86,9 +89,12 @@ TEST(sys_msg, msgget_failure) {
}
TEST(sys_msg, msgrcv_failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
errno = 0;
ASSERT_EQ(-1, msgrcv(-1, nullptr, 0, 0, 0));
ASSERT_TRUE(errno == EINVAL || errno == ENOSYS);
+#pragma clang diagnostic pop
}
TEST(sys_msg, msgsnd_failure) {