[v2,2/2] Use __nonnull for the epoll_wait(2) family of syscalls
Checks
Commit Message
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
include/sys/epoll.h | 3 ++-
sysdeps/unix/sysv/linux/sys/epoll.h | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
Comments
On 31/05/23 17:44, Alejandro Colomar wrote:
> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
> Signed-off-by: Alejandro Colomar <alx@kernel.org>
LGTM, although the buildbot failed to apply the patch for some reason [1].
It does apply if I use git-pw.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
[1] https://patchwork.sourceware.org/project/glibc/patch/20230531204422.18052-2-alx@kernel.org/
> ---
> include/sys/epoll.h | 3 ++-
> sysdeps/unix/sysv/linux/sys/epoll.h | 8 ++++----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/include/sys/epoll.h b/include/sys/epoll.h
> index 8049381a26..b23bc9c7c0 100644
> --- a/include/sys/epoll.h
> +++ b/include/sys/epoll.h
> @@ -9,7 +9,8 @@ libc_hidden_proto (epoll_pwait)
> #else
> extern int __epoll_pwait2_time64 (int fd, struct epoll_event *ev, int maxev,
> const struct __timespec64 *tmo,
> - const sigset_t *s);
> + const sigset_t *s)
> + __nonnull ((2));
> libc_hidden_proto (__epoll_pwait2_time64)
> #endif
>
> diff --git a/sysdeps/unix/sysv/linux/sys/epoll.h b/sysdeps/unix/sysv/linux/sys/epoll.h
> index b17d344e79..23872c9438 100644
> --- a/sysdeps/unix/sysv/linux/sys/epoll.h
> +++ b/sysdeps/unix/sysv/linux/sys/epoll.h
> @@ -123,7 +123,7 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
> __THROW. */
> extern int epoll_wait (int __epfd, struct epoll_event *__events,
> int __maxevents, int __timeout)
> - __attr_access ((__write_only__, 2, 3));
> + __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
>
>
> /* Same as epoll_wait, but the thread's signal mask is temporarily
> @@ -134,7 +134,7 @@ extern int epoll_wait (int __epfd, struct epoll_event *__events,
> extern int epoll_pwait (int __epfd, struct epoll_event *__events,
> int __maxevents, int __timeout,
> const __sigset_t *__ss)
> - __attr_access ((__write_only__, 2, 3));
> + __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
>
> /* Same as epoll_pwait, but the timeout as a timespec.
>
> @@ -144,7 +144,7 @@ extern int epoll_pwait (int __epfd, struct epoll_event *__events,
> extern int epoll_pwait2 (int __epfd, struct epoll_event *__events,
> int __maxevents, const struct timespec *__timeout,
> const __sigset_t *__ss)
> - __attr_access ((__write_only__, 2, 3));
> + __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
> #else
> # ifdef __REDIRECT
> extern int __REDIRECT (epoll_pwait2, (int __epfd, struct epoll_event *__ev,
> @@ -152,7 +152,7 @@ extern int __REDIRECT (epoll_pwait2, (int __epfd, struct epoll_event *__ev,
> const struct timespec *__timeout,
> const __sigset_t *__ss),
> __epoll_pwait2_time64)
> - __attr_access ((__write_only__, 2, 3));
> + __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
> # else
> # define epoll_pwait2 __epoll_pwait2_time64
> # endif
On 6/1/23 20:00, Adhemerval Zanella Netto wrote:
>
>
> On 31/05/23 17:44, Alejandro Colomar wrote:
>> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
>> Signed-off-by: Alejandro Colomar <alx@kernel.org>
>
>
> LGTM, although the buildbot failed to apply the patch for some reason [1].
Don't know; maybe I forgot to rebase to the latest master, and some context
changed, and it applied with fuzz... git can apply it, but the buildbot is
probably more cautious.
> It does apply if I use git-pw.
>
> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Thank you!
(you forgot to actually put this tag in 1/2 :)
Cheers,
Alex
>
> [1] https://patchwork.sourceware.org/project/glibc/patch/20230531204422.18052-2-alx@kernel.org/
>
@@ -9,7 +9,8 @@ libc_hidden_proto (epoll_pwait)
#else
extern int __epoll_pwait2_time64 (int fd, struct epoll_event *ev, int maxev,
const struct __timespec64 *tmo,
- const sigset_t *s);
+ const sigset_t *s)
+ __nonnull ((2));
libc_hidden_proto (__epoll_pwait2_time64)
#endif
@@ -123,7 +123,7 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
__THROW. */
extern int epoll_wait (int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout)
- __attr_access ((__write_only__, 2, 3));
+ __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
/* Same as epoll_wait, but the thread's signal mask is temporarily
@@ -134,7 +134,7 @@ extern int epoll_wait (int __epfd, struct epoll_event *__events,
extern int epoll_pwait (int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout,
const __sigset_t *__ss)
- __attr_access ((__write_only__, 2, 3));
+ __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
/* Same as epoll_pwait, but the timeout as a timespec.
@@ -144,7 +144,7 @@ extern int epoll_pwait (int __epfd, struct epoll_event *__events,
extern int epoll_pwait2 (int __epfd, struct epoll_event *__events,
int __maxevents, const struct timespec *__timeout,
const __sigset_t *__ss)
- __attr_access ((__write_only__, 2, 3));
+ __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
#else
# ifdef __REDIRECT
extern int __REDIRECT (epoll_pwait2, (int __epfd, struct epoll_event *__ev,
@@ -152,7 +152,7 @@ extern int __REDIRECT (epoll_pwait2, (int __epfd, struct epoll_event *__ev,
const struct timespec *__timeout,
const __sigset_t *__ss),
__epoll_pwait2_time64)
- __attr_access ((__write_only__, 2, 3));
+ __attr_access ((__write_only__, 2, 3)) __nonnull ((2));
# else
# define epoll_pwait2 __epoll_pwait2_time64
# endif