2022-12-03 20:42:08

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 00/41] Document nullability of syscall parameters


Hi!

This patch set documents which parameters of syscalls accept NULL.
Actually, some syscalls may also accept it (but return always an error),
but per the recent discussion on the glibc mailing list, I decided to
ignore that behavior and treat them as if they were _Nonnull.

So when a function is documented with a _Nullable parameter, it means
that calling the function with NULL is meaningful.

I decided to use one of the Clang qualifiers because the
[[gnu::nonnull]] attribute is not as precise (for example in the case of
pointers to pointers).

I decided to use _Nullable and not _Nonnull because there are many more
functions that don't accept NULL than those that do, so _Nullable is the
least noisy.

When POSIX or other systems are more restrictive than GNU/Linux, I chose
to be more restrictive in the prototype, to avoid confusion (this is
similar to what was done with 'restrict', which was specified if any
system or POSIX used it, even if glibc didn't require restrict --maybe
those were glibc bugs--).


Cheers,

Alex



Alejandro Colomar (41):
accept.2: SYNOPSIS: Add _Nullable
acct.2: SYNOPSIS: Add _Nullable
clock_getres.2: SYNOPSIS: Add _Nullable
clock_nanosleep.2: SYNOPSIS: Add _Nullable
clone.2: SYNOPSIS: Add _Nullable
copy_file_range.2: SYNOPSIS: Add _Nullable
epoll_ctl.2: SYNOPSIS: Add _Nullable
epoll_wait.2: SYNOPSIS: Add _Nullable
execve.2: SYNOPSIS: Add _Nullable
execveat.2: SYNOPSIS: Add _Nullable
fanotify_mark.2: SYNOPSIS: Add _Nullable
getcpu.2: SYNOPSIS: Add _Nullable
getgroups.2: SYNOPSIS: Add _Nullable
getitimer.2: SYNOPSIS: Add _Nullable
getrlimit.2: SYNOPSIS: Add _Nullable
gettimeofday.2: SYNOPSIS: Add _Nullable
listxattr.2: SYNOPSIS: Add _Nullable
mount.2: SYNOPSIS: Add _Nullable
nanosleep.2: SYNOPSIS: Add _Nullable
pidfd_send_signal.2: SYNOPSIS: Add _Nullable
poll.2: SYNOPSIS: Add _Nullable
quotactl.2: SYNOPSIS: Add _Nullable
recv.2: SYNOPSIS: Add _Nullable
request_key.2: SYNOPSIS: Add _Nullable
select.2: SYNOPSIS: Add _Nullable
semop.2: SYNOPSIS: Add _Nullable
sendfile.2: SYNOPSIS: Add _Nullable
shmop.2: SYNOPSIS: Add _Nullable
sigaction.2: SYNOPSIS: Add _Nullable
sigaltstack.2: SYNOPSIS: Add _Nullable
sigprocmask.2: SYNOPSIS: Add _Nullable
sigwaitinfo.2: SYNOPSIS: Add _Nullable
splice.2: SYNOPSIS: Add _Nullable
time.2: SYNOPSIS: Add _Nullable
timer_create.2: SYNOPSIS: Add _Nullable
timer_settime.2: SYNOPSIS: Add _Nullable
timerfd_create.2: SYNOPSIS: Add _Nullable
utime.2: SYNOPSIS: Add _Nullable
utimensat.2: SYNOPSIS: Add _Nullable
wait.2: SYNOPSIS: Add _Nullable
wait4.2: SYNOPSIS: Add _Nullable

man2/accept.2 | 8 ++++----
man2/acct.2 | 2 +-
man2/clock_getres.2 | 2 +-
man2/clock_nanosleep.2 | 2 +-
man2/clone.2 | 10 ++++++----
man2/copy_file_range.2 | 4 ++--
man2/epoll_ctl.2 | 2 +-
man2/epoll_wait.2 | 7 ++++---
man2/execve.2 | 4 ++--
man2/execveat.2 | 3 ++-
man2/fanotify_mark.2 | 4 ++--
man2/getcpu.2 | 3 ++-
man2/getgroups.2 | 2 +-
man2/getitimer.2 | 2 +-
man2/getrlimit.2 | 5 +++--
man2/gettimeofday.2 | 4 ++--
man2/listxattr.2 | 6 +++---
man2/mount.2 | 2 +-
man2/nanosleep.2 | 3 ++-
man2/pidfd_send_signal.2 | 5 ++---
man2/poll.2 | 3 ++-
man2/quotactl.2 | 4 ++--
man2/recv.2 | 4 ++--
man2/request_key.2 | 2 +-
man2/select.2 | 16 +++++++++-------
man2/semop.2 | 2 +-
man2/sendfile.2 | 5 +++--
man2/shmop.2 | 3 ++-
man2/sigaction.2 | 5 +++--
man2/sigaltstack.2 | 4 ++--
man2/sigprocmask.2 | 15 ++++++++-------
man2/sigwaitinfo.2 | 4 ++--
man2/splice.2 | 6 +++---
man2/time.2 | 2 +-
man2/timer_create.2 | 3 ++-
man2/timer_settime.2 | 2 +-
man2/timerfd_create.2 | 2 +-
man2/utime.2 | 6 ++++--
man2/utimensat.2 | 4 ++--
man2/wait.2 | 4 ++--
man2/wait4.2 | 7 ++++---
41 files changed, 100 insertions(+), 83 deletions(-)

--
2.38.1


2022-12-03 20:42:15

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 17/41] listxattr.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/listxattr.2 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man2/listxattr.2 b/man2/listxattr.2
index 87b49ebb8..8ca1b7f58 100644
--- a/man2/listxattr.2
+++ b/man2/listxattr.2
@@ -14,11 +14,11 @@ .SH SYNOPSIS
.nf
.B #include <sys/xattr.h>
.PP
-.BI "ssize_t listxattr(const char *" path ", char *" list \
+.BI "ssize_t listxattr(const char *" path ", char *_Nullable " list \
", size_t " size );
-.BI "ssize_t llistxattr(const char *" path ", char *" list \
+.BI "ssize_t llistxattr(const char *" path ", char *_Nullable " list \
", size_t " size );
-.BI "ssize_t flistxattr(int " fd ", char *" list ", size_t " size );
+.BI "ssize_t flistxattr(int " fd ", char *_Nullable " list ", size_t " size );
.fi
.SH DESCRIPTION
Extended attributes are
--
2.38.1

2022-12-03 20:44:08

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 31/41] sigprocmask.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/sigprocmask.2 | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/man2/sigprocmask.2 b/man2/sigprocmask.2
index 6fa655fea..ae65e3400 100644
--- a/man2/sigprocmask.2
+++ b/man2/sigprocmask.2
@@ -17,22 +17,23 @@ .SH SYNOPSIS
.PP
.nf
/* Prototype for the glibc wrapper function */
-.BI "int sigprocmask(int " how ", const sigset_t *restrict " set ,
-.BI " sigset_t *restrict " oldset );
+.BI "int sigprocmask(int " how ", const sigset_t *_Nullable restrict " set ,
+.BI " sigset_t *_Nullable restrict " oldset );
.PP
.BR "#include <signal.h>" " /* Definition of " SIG_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
/* Prototype for the underlying system call */
-.BI "int syscall(SYS_rt_sigprocmask, int " how ", const kernel_sigset_t *" set ,
-.BI " kernel_sigset_t *" oldset \
-", size_t " sigsetsize );
+.BI "int syscall(SYS_rt_sigprocmask, int " how ,
+.BI " const kernel_sigset_t *_Nullable " set ,
+.BI " kernel_sigset_t *_Nullable " oldset ,
+.BI " size_t " sigsetsize );
.PP
/* Prototype for the legacy system call */
.BI "[[deprecated]] int syscall(SYS_sigprocmask, int " how ,
-.BI " const old_kernel_sigset_t *" set ,
-.BI " old_kernel_sigset_t *" oldset );
+.BI " const old_kernel_sigset_t *_Nullable " set ,
+.BI " old_kernel_sigset_t *_Nullable " oldset );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:44:22

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 15/41] getrlimit.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/getrlimit.2 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/man2/getrlimit.2 b/man2/getrlimit.2
index c27709e18..56003da49 100644
--- a/man2/getrlimit.2
+++ b/man2/getrlimit.2
@@ -54,8 +54,9 @@ .SH SYNOPSIS
.BI "int getrlimit(int " resource ", struct rlimit *" rlim );
.BI "int setrlimit(int " resource ", const struct rlimit *" rlim );
.PP
-.BI "int prlimit(pid_t " pid ", int " resource ", const struct rlimit *" new_limit ,
-.BI " struct rlimit *" old_limit );
+.BI "int prlimit(pid_t " pid ", int " resource ,
+.BI " const struct rlimit *_Nullable " new_limit ,
+.BI " struct rlimit *_Nullable " old_limit );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:45:14

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 41/41] wait4.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/wait4.2 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man2/wait4.2 b/man2/wait4.2
index 82983ac0b..6f011fe0e 100644
--- a/man2/wait4.2
+++ b/man2/wait4.2
@@ -20,9 +20,10 @@ .SH SYNOPSIS
.nf
.B #include <sys/wait.h>
.PP
-.BI "pid_t wait3(int *" "wstatus" ", int " options ", struct rusage *" rusage );
-.BI "pid_t wait4(pid_t " pid ", int *" wstatus ", int " options ,
-.BI " struct rusage *" rusage );
+.BI "pid_t wait3(int *_Nullable " "wstatus" ", int " options ,
+.BI " struct rusage *_Nullable " rusage );
+.BI "pid_t wait4(pid_t " pid ", int *_Nullable " wstatus ", int " options ,
+.BI " struct rusage *_Nullable " rusage );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:45:15

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 10/41] execveat.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/execveat.2 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man2/execveat.2 b/man2/execveat.2
index c54d30996..b8c3be237 100644
--- a/man2/execveat.2
+++ b/man2/execveat.2
@@ -15,7 +15,8 @@ .SH SYNOPSIS
.B #include <unistd.h>
.PP
.BI "int execveat(int " dirfd ", const char *" pathname ,
-.BI " const char *const " argv "[], const char *const " envp [],
+.BI " const char *const _Nullable " argv [],
+.BI " const char *const _Nullable " envp [],
.BI " int " flags );
.fi
.SH DESCRIPTION
--
2.38.1

2022-12-03 20:45:46

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 28/41] shmop.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/shmop.2 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man2/shmop.2 b/man2/shmop.2
index e5a0ae814..cd91c9931 100644
--- a/man2/shmop.2
+++ b/man2/shmop.2
@@ -27,7 +27,8 @@ .SH SYNOPSIS
.nf
.B #include <sys/shm.h>
.PP
-.BI "void *shmat(int " shmid ", const void *" shmaddr ", int " shmflg );
+.BI "void *shmat(int " shmid ", const void *_Nullable " shmaddr ", \
+int " shmflg );
.BI "int shmdt(const void *" shmaddr );
.fi
.SH DESCRIPTION
--
2.38.1

2022-12-03 20:46:47

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 16/41] gettimeofday.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/gettimeofday.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/gettimeofday.2 b/man2/gettimeofday.2
index 1c9775820..8ef5ac271 100644
--- a/man2/gettimeofday.2
+++ b/man2/gettimeofday.2
@@ -28,9 +28,9 @@ .SH SYNOPSIS
.B #include <sys/time.h>
.PP
.BI "int gettimeofday(struct timeval *restrict " tv ,
-.BI " struct timezone *restrict " tz );
+.BI " struct timezone *_Nullable restrict " tz );
.BI "int settimeofday(const struct timeval *" tv ,
-.BI " const struct timezone *" tz );
+.BI " const struct timezone *_Nullable " tz );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:47:06

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 08/41] epoll_wait.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/epoll_wait.2 | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man2/epoll_wait.2 b/man2/epoll_wait.2
index 100a9211e..59ad4fa3f 100644
--- a/man2/epoll_wait.2
+++ b/man2/epoll_wait.2
@@ -21,10 +21,11 @@ .SH SYNOPSIS
.BI " int " maxevents ", int " timeout );
.BI "int epoll_pwait(int " epfd ", struct epoll_event *" events ,
.BI " int " maxevents ", int " timeout ,
-.BI " const sigset_t *" sigmask );
+.BI " const sigset_t *_Nullable " sigmask );
.BI "int epoll_pwait2(int " epfd ", struct epoll_event *" events ,
-.BI " int " maxevents ", const struct timespec *" timeout ,
-.BI " const sigset_t *" sigmask );
+.BI " int " maxevents ", \
+const struct timespec *_Nullable " timeout ,
+.BI " const sigset_t *_Nullable " sigmask );
.fi
.SH DESCRIPTION
The
--
2.38.1

2022-12-03 20:48:56

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 21/41] poll.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/poll.2 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man2/poll.2 b/man2/poll.2
index 0d67a6add..fa22e2002 100644
--- a/man2/poll.2
+++ b/man2/poll.2
@@ -23,7 +23,8 @@ .SH SYNOPSIS
.B #include <poll.h>
.PP
.BI "int ppoll(struct pollfd *" fds ", nfds_t " nfds ,
-.BI " const struct timespec *" tmo_p ", const sigset_t *" sigmask );
+.BI " const struct timespec *_Nullable " tmo_p ,
+.BI " const sigset_t *_Nullable " sigmask );
.fi
.SH DESCRIPTION
.BR poll ()
--
2.38.1

2022-12-03 20:49:11

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 23/41] recv.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/recv.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/recv.2 b/man2/recv.2
index d492976c4..5298a2745 100644
--- a/man2/recv.2
+++ b/man2/recv.2
@@ -24,8 +24,8 @@ .SH SYNOPSIS
.BI " int " flags );
.BI "ssize_t recvfrom(int " sockfd ", void " buf "[restrict ." len "], size_t " len ,
.BI " int " flags ,
-.BI " struct sockaddr *restrict " src_addr ,
-.BI " socklen_t *restrict " addrlen );
+.BI " struct sockaddr *_Nullable restrict " src_addr ,
+.BI " socklen_t *_Nullable restrict " addrlen );
.BI "ssize_t recvmsg(int " sockfd ", struct msghdr *" msg ", int " flags );
.fi
.SH DESCRIPTION
--
2.38.1

2022-12-03 20:49:17

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 27/41] sendfile.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/sendfile.2 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/man2/sendfile.2 b/man2/sendfile.2
index a50f2797a..9dbe1691c 100644
--- a/man2/sendfile.2
+++ b/man2/sendfile.2
@@ -26,8 +26,9 @@ .SH SYNOPSIS
.nf
.B #include <sys/sendfile.h>
.PP
-.BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", off_t *" \
- offset ", size_t" " count" );
+.BI "ssize_t sendfile(int" " out_fd" ", int" " in_fd" ", \
+off_t *_Nullable " offset ,
+.BI " size_t" " count" );
.\" The below is too ugly. Comments about glibc versions belong
.\" in the notes, not in the header.
.\"
--
2.38.1

2022-12-03 20:49:29

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 37/41] timerfd_create.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/timerfd_create.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/timerfd_create.2 b/man2/timerfd_create.2
index 078a2d4b9..1b2fb3ff9 100644
--- a/man2/timerfd_create.2
+++ b/man2/timerfd_create.2
@@ -17,7 +17,7 @@ .SH SYNOPSIS
.PP
.BI "int timerfd_settime(int " fd ", int " flags ,
.BI " const struct itimerspec *" new_value ,
-.BI " struct itimerspec *" old_value );
+.BI " struct itimerspec *_Nullable " old_value );
.BI "int timerfd_gettime(int " fd ", struct itimerspec *" curr_value );
.fi
.SH DESCRIPTION
--
2.38.1

2022-12-03 20:50:15

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 18/41] mount.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/mount.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/mount.2 b/man2/mount.2
index 1ef0cdd06..9e89c16ef 100644
--- a/man2/mount.2
+++ b/man2/mount.2
@@ -29,7 +29,7 @@ .SH SYNOPSIS
.PP
.BI "int mount(const char *" source ", const char *" target ,
.BI " const char *" filesystemtype ", unsigned long " mountflags ,
-.BI " const void *" data );
+.BI " const void *_Nullable " data );
.fi
.SH DESCRIPTION
.BR mount ()
--
2.38.1

2022-12-03 20:50:30

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 24/41] request_key.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/request_key.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/request_key.2 b/man2/request_key.2
index 78493b640..b9c4f2a00 100644
--- a/man2/request_key.2
+++ b/man2/request_key.2
@@ -15,7 +15,7 @@ .SH SYNOPSIS
.B #include <keyutils.h>
.PP
.BI "key_serial_t request_key(const char *" type ", const char *" description ,
-.BI " const char *" callout_info ,
+.BI " const char *_Nullable " callout_info ,
.BI " key_serial_t " dest_keyring );
.fi
.SH DESCRIPTION
--
2.38.1

2022-12-03 20:50:42

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 40/41] wait.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/wait.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/wait.2 b/man2/wait.2
index 7f958ea71..6a5a1309f 100644
--- a/man2/wait.2
+++ b/man2/wait.2
@@ -36,8 +36,8 @@ .SH SYNOPSIS
.nf
.B #include <sys/wait.h>
.PP
-.BI "pid_t wait(int *" "wstatus" );
-.BI "pid_t waitpid(pid_t " pid ", int *" wstatus ", int " options );
+.BI "pid_t wait(int *_Nullable " "wstatus" );
+.BI "pid_t waitpid(pid_t " pid ", int *_Nullable " wstatus ", int " options );
.PP
.BI "int waitid(idtype_t " idtype ", id_t " id \
", siginfo_t *" infop ", int " options );
--
2.38.1

2022-12-03 20:50:42

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 29/41] sigaction.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/sigaction.2 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/man2/sigaction.2 b/man2/sigaction.2
index d43f9b0d0..b6ad9d63f 100644
--- a/man2/sigaction.2
+++ b/man2/sigaction.2
@@ -35,8 +35,9 @@ .SH SYNOPSIS
.nf
.B #include <signal.h>
.PP
-.BI "int sigaction(int " signum ", const struct sigaction *restrict " act ,
-.BI " struct sigaction *restrict " oldact );
+.BI "int sigaction(int " signum ,
+.BI " const struct sigaction *_Nullable restrict " act ,
+.BI " struct sigaction *_Nullable restrict " oldact );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:50:49

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 09/41] execve.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/execve.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/execve.2 b/man2/execve.2
index 54c2d0040..35eba65f1 100644
--- a/man2/execve.2
+++ b/man2/execve.2
@@ -24,8 +24,8 @@ .SH SYNOPSIS
.nf
.B #include <unistd.h>
.PP
-.BI "int execve(const char *" pathname ", char *const " argv [],
-.BI " char *const " envp []);
+.BI "int execve(const char *" pathname ", char *const _Nullable " argv [],
+.BI " char *const _Nullable " envp []);
.fi
.SH DESCRIPTION
.BR execve ()
--
2.38.1

2022-12-03 20:51:23

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 35/41] timer_create.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/timer_create.2 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man2/timer_create.2 b/man2/timer_create.2
index f17ef4a8a..bb5e6e238 100644
--- a/man2/timer_create.2
+++ b/man2/timer_create.2
@@ -14,7 +14,8 @@ .SH SYNOPSIS
.BR "#include <signal.h>" " /* Definition of " SIGEV_* " constants */"
.B #include <time.h>
.PP
-.BI "int timer_create(clockid_t " clockid ", struct sigevent *restrict " sevp ,
+.BI "int timer_create(clockid_t " clockid ,
+.BI " struct sigevent *_Nullable restrict " sevp ,
.BI " timer_t *restrict " timerid );
.fi
.PP
--
2.38.1

2022-12-03 20:52:00

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 36/41] timer_settime.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/timer_settime.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/timer_settime.2 b/man2/timer_settime.2
index c52768be0..29d9ed4d2 100644
--- a/man2/timer_settime.2
+++ b/man2/timer_settime.2
@@ -16,7 +16,7 @@ .SH SYNOPSIS
.PP
.BI "int timer_settime(timer_t " timerid ", int " flags ,
.BI " const struct itimerspec *restrict " new_value ,
-.BI " struct itimerspec *restrict " old_value );
+.BI " struct itimerspec *_Nullable restrict " old_value );
.BI "int timer_gettime(timer_t " timerid ", struct itimerspec *" curr_value );
.fi
.PP
--
2.38.1

2022-12-03 20:52:01

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 11/41] fanotify_mark.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/fanotify_mark.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/fanotify_mark.2 b/man2/fanotify_mark.2
index 6cd3ae2ae..f49759ed4 100644
--- a/man2/fanotify_mark.2
+++ b/man2/fanotify_mark.2
@@ -13,8 +13,8 @@ .SH SYNOPSIS
.B #include <sys/fanotify.h>
.PP
.BI "int fanotify_mark(int " fanotify_fd ", unsigned int " flags ,
-.BI " uint64_t " mask ", int " dirfd \
-", const char *" pathname );
+.BI " uint64_t " mask ", int " dirfd ,
+.BI " const char *_Nullable " pathname );
.fi
.SH DESCRIPTION
For an overview of the fanotify API, see
--
2.38.1

2022-12-03 20:52:31

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 22/41] quotactl.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/quotactl.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/quotactl.2 b/man2/quotactl.2
index e5c6a5ea6..9fb81801b 100644
--- a/man2/quotactl.2
+++ b/man2/quotactl.2
@@ -17,8 +17,8 @@ .SH SYNOPSIS
" constants"
.RB " (or " <linux/dqblk_xfs.h> "; see NOTES) */"
.PP
-.BI "int quotactl(int " cmd ", const char *" special ", int " id \
-", caddr_t " addr );
+.BI "int quotactl(int " cmd ", const char *_Nullable " special ", int " id ,
+.BI " caddr_t " addr );
.fi
.SH DESCRIPTION
The quota system can be used to set per-user, per-group, and per-project limits
--
2.38.1

2022-12-03 20:52:32

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 32/41] sigwaitinfo.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/sigwaitinfo.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/sigwaitinfo.2 b/man2/sigwaitinfo.2
index 96cf54e9a..42209c180 100644
--- a/man2/sigwaitinfo.2
+++ b/man2/sigwaitinfo.2
@@ -14,9 +14,9 @@ .SH SYNOPSIS
.B #include <signal.h>
.PP
.BI "int sigwaitinfo(const sigset_t *restrict " set ,
-.BI " siginfo_t *restrict " info );
+.BI " siginfo_t *_Nullable restrict " info );
.BI "int sigtimedwait(const sigset_t *restrict " set ,
-.BI " siginfo_t *restrict " info ,
+.BI " siginfo_t *_Nullable restrict " info ,
.BI " const struct timespec *restrict " timeout );
.fi
.PP
--
2.38.1

2022-12-03 20:53:09

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 38/41] utime.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/utime.2 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/man2/utime.2 b/man2/utime.2
index cee165344..c364c4390 100644
--- a/man2/utime.2
+++ b/man2/utime.2
@@ -18,11 +18,13 @@ .SH SYNOPSIS
.nf
.B #include <utime.h>
.PP
-.BI "int utime(const char *" filename ", const struct utimbuf *" times );
+.BI "int utime(const char *" filename ,
+.BI " const struct utimbuf *_Nullable " times );
.PP
.B #include <sys/time.h>
.PP
-.BI "int utimes(const char *" filename ", const struct timeval " times [2]);
+.BI "int utimes(const char *" filename ,
+.BI " const struct timeval " times "[_Nullable 2]);"
.fi
.SH DESCRIPTION
.B Note:
--
2.38.1

2022-12-03 20:53:37

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 19/41] nanosleep.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/nanosleep.2 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man2/nanosleep.2 b/man2/nanosleep.2
index 63603971c..969c34609 100644
--- a/man2/nanosleep.2
+++ b/man2/nanosleep.2
@@ -22,7 +22,8 @@ .SH SYNOPSIS
.nf
.B #include <time.h>
.PP
-.BI "int nanosleep(const struct timespec *" req ", struct timespec *" rem );
+.BI "int nanosleep(const struct timespec *" req ,
+.BI " struct timespec *_Nullable " rem );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:54:02

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 26/41] semop.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/semop.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/semop.2 b/man2/semop.2
index ebe37a55c..ad184829e 100644
--- a/man2/semop.2
+++ b/man2/semop.2
@@ -24,7 +24,7 @@ .SH SYNOPSIS
.PP
.BI "int semop(int " semid ", struct sembuf *" sops ", size_t " nsops );
.BI "int semtimedop(int " semid ", struct sembuf *" sops ", size_t " nsops ,
-.BI " const struct timespec *" timeout );
+.BI " const struct timespec *_Nullable " timeout );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 20:54:21

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 12/41] getcpu.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/getcpu.2 | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man2/getcpu.2 b/man2/getcpu.2
index 0e7293105..32a5e926d 100644
--- a/man2/getcpu.2
+++ b/man2/getcpu.2
@@ -20,7 +20,8 @@ .SH SYNOPSIS
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sched.h>
.PP
-.BI "int getcpu(unsigned int *" cpu ", unsigned int *" node );
+.BI "int getcpu(unsigned int *_Nullable " cpu ", \
+unsigned int *_Nullable " node );
.fi
.SH DESCRIPTION
The
--
2.38.1

2022-12-03 20:55:38

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 33/41] splice.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/splice.2 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man2/splice.2 b/man2/splice.2
index 4e6582f71..b5c453771 100644
--- a/man2/splice.2
+++ b/man2/splice.2
@@ -14,9 +14,9 @@ .SH SYNOPSIS
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <fcntl.h>
.PP
-.BI "ssize_t splice(int " fd_in ", off64_t *" off_in ", int " fd_out ,
-.BI " off64_t *" off_out ", size_t " len \
-", unsigned int " flags );
+.BI "ssize_t splice(int " fd_in ", off64_t *_Nullable " off_in ,
+.BI " int " fd_out ", off64_t *_Nullable " off_out ,
+.BI " size_t " len ", unsigned int " flags );
.\" Return type was long before glibc 2.7
.fi
.SH DESCRIPTION
--
2.38.1

2022-12-03 20:55:44

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 14/41] getitimer.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/getitimer.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/getitimer.2 b/man2/getitimer.2
index 0736837a4..3c86acfd5 100644
--- a/man2/getitimer.2
+++ b/man2/getitimer.2
@@ -22,7 +22,7 @@ .SH SYNOPSIS
.PP
.BI "int getitimer(int " which ", struct itimerval *" curr_value );
.BI "int setitimer(int " which ", const struct itimerval *restrict " new_value ,
-.BI " struct itimerval *restrict " old_value );
+.BI " struct itimerval *_Nullable restrict " old_value );
.fi
.SH DESCRIPTION
These system calls provide access to interval timers, that is,
--
2.38.1

2022-12-03 21:19:09

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 34/41] time.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/time.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/time.2 b/man2/time.2
index e9a09ba9b..2be79cf78 100644
--- a/man2/time.2
+++ b/man2/time.2
@@ -16,7 +16,7 @@ .SH SYNOPSIS
.nf
.B #include <time.h>
.PP
-.BI "time_t time(time_t *" tloc );
+.BI "time_t time(time_t *_Nullable " tloc );
.fi
.SH DESCRIPTION
.BR time ()
--
2.38.1

2022-12-03 21:19:50

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 02/41] acct.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/acct.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/acct.2 b/man2/acct.2
index 1a676b7c7..f9fc1cd5c 100644
--- a/man2/acct.2
+++ b/man2/acct.2
@@ -19,7 +19,7 @@ .SH SYNOPSIS
.nf
.B #include <unistd.h>
.PP
-.BI "int acct(const char *" filename );
+.BI "int acct(const char *_Nullable " filename );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 21:21:20

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 20/41] pidfd_send_signal.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/pidfd_send_signal.2 | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/man2/pidfd_send_signal.2 b/man2/pidfd_send_signal.2
index 93d0c90cf..2a60ced93 100644
--- a/man2/pidfd_send_signal.2
+++ b/man2/pidfd_send_signal.2
@@ -15,9 +15,8 @@ .SH SYNOPSIS
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP
-.BI "int syscall(SYS_pidfd_send_signal, int " pidfd ", int " sig \
-", siginfo_t *" info ,
-.BI " unsigned int " flags );
+.BI "int syscall(SYS_pidfd_send_signal, int " pidfd ", int " sig ,
+.BI " siginfo_t *_Nullable " info ", unsigned int " flags );
.fi
.PP
.IR Note :
--
2.38.1

2022-12-03 21:27:37

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 25/41] select.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/select.2 | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/man2/select.2 b/man2/select.2
index 199522a01..f13d20420 100644
--- a/man2/select.2
+++ b/man2/select.2
@@ -30,19 +30,21 @@ .SH SYNOPSIS
.PP
.BR typedef " /* ... */ " fd_set;
.PP
-.BI "int select(int " nfds ", fd_set *restrict " readfds ,
-.BI " fd_set *restrict " writefds ", fd_set *restrict " exceptfds ,
-.BI " struct timeval *restrict " timeout );
+.BI "int select(int " nfds ", fd_set *_Nullable restrict " readfds ,
+.BI " fd_set *_Nullable restrict " writefds ,
+.BI " fd_set *_Nullable restrict " exceptfds ,
+.BI " struct timeval *_Nullable restrict " timeout );
.PP
.BI "void FD_CLR(int " fd ", fd_set *" set );
.BI "int FD_ISSET(int " fd ", fd_set *" set );
.BI "void FD_SET(int " fd ", fd_set *" set );
.BI "void FD_ZERO(fd_set *" set );
.PP
-.BI "int pselect(int " nfds ", fd_set *restrict " readfds ,
-.BI " fd_set *restrict " writefds ", fd_set *restrict " exceptfds ,
-.BI " const struct timespec *restrict " timeout ,
-.BI " const sigset_t *restrict " sigmask );
+.BI "int pselect(int " nfds ", fd_set *_Nullable restrict " readfds ,
+.BI " fd_set *_Nullable restrict " writefds ,
+.BI " fd_set *_Nullable restrict " exceptfds ,
+.BI " const struct timespec *_Nullable restrict " timeout ,
+.BI " const sigset_t *_Nullable restrict " sigmask );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 21:29:35

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 05/41] clone.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/clone.2 | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/man2/clone.2 b/man2/clone.2
index 093630859..a3e6188fd 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -50,10 +50,12 @@ .SH SYNOPSIS
.B #define _GNU_SOURCE
.B #include <sched.h>
.PP
-.BI "int clone(int (*" "fn" ")(void *), void *" stack \
-", int " flags ", void *" "arg" ", ..."
-.BI " /* pid_t *" parent_tid ", void *" tls \
-", pid_t *" child_tid " */ );"
+.BI "int clone(int (*" "fn" ")(void *_Nullable), void *" stack \
+", int " flags ,
+.BI " void *_Nullable " "arg" ", ..." \
+" \fR/*\fP" " pid_t *_Nullable " parent_tid ,
+.BI " void *_Nullable " tls ,
+.BI " pid_t *_Nullable " child_tid " \fR*/\fP );"
.PP
/* For the prototype of the raw clone() system call, see NOTES */
.PP
--
2.38.1

2022-12-03 21:33:44

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 13/41] getgroups.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/getgroups.2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/getgroups.2 b/man2/getgroups.2
index 7ec9e5a68..f0687018d 100644
--- a/man2/getgroups.2
+++ b/man2/getgroups.2
@@ -23,7 +23,7 @@ .SH SYNOPSIS
.PP
.B #include <grp.h>
.PP
-.BI "int setgroups(size_t " size ", const gid_t *" list );
+.BI "int setgroups(size_t " size ", const gid_t *_Nullable " list );
.fi
.PP
.RS -4
--
2.38.1

2022-12-03 21:35:41

by Alejandro Colomar

[permalink] [raw]
Subject: [PATCH 39/41] utimensat.2: SYNOPSIS: Add _Nullable

Signed-off-by: Alejandro Colomar <[email protected]>
---
man2/utimensat.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/utimensat.2 b/man2/utimensat.2
index df33a1f7e..0a8774156 100644
--- a/man2/utimensat.2
+++ b/man2/utimensat.2
@@ -15,8 +15,8 @@ .SH SYNOPSIS
.B #include <sys/stat.h>
.PP
.BI "int utimensat(int " dirfd ", const char *" pathname ,
-.BI " const struct timespec " times "[2], int " flags );
-.BI "int futimens(int " fd ", const struct timespec " times [2]);
+.BI " const struct timespec " times "[_Nullable 2], int " flags );
+.BI "int futimens(int " fd ", const struct timespec " times "[_Nullable 2]);"
.fi
.PP
.RS -4
--
2.38.1