[PATCH] Add access function attributes to epoll_wait

Siddhesh Poyarekar siddhesh@gotplt.org
Mon Mar 14 08:06:36 GMT 2022


On 11/03/2022 20:10, Steve Grubb via Libc-alpha wrote:
> This patch adds write access function attributes to the epoll_wait family of
> functions
> 
> ---

LGTM.  I'll push it once test finishes.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>


>   epoll.h |   12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> ---
> diff -urp glibc-2.35.9000-111-g2bbc694df2.orig/sysdeps/unix/sysv/linux/sys/epoll.h glibc-2.35.9000-111-g2bbc694df2/sysdeps/unix/sysv/linux/sys/epoll.h
> --- glibc-2.35.9000-111-g2bbc694df2.orig/sysdeps/unix/sysv/linux/sys/epoll.h	2022-02-28 10:47:38.000000000 -0500
> +++ glibc-2.35.9000-111-g2bbc694df2/sysdeps/unix/sysv/linux/sys/epoll.h	2022-03-11 09:04:19.248065912 -0500
> @@ -122,7 +122,8 @@ extern int epoll_ctl (int __epfd, int __
>      This function is a cancellation point and therefore not marked with
>      __THROW.  */
>   extern int epoll_wait (int __epfd, struct epoll_event *__events,
> -		       int __maxevents, int __timeout);
> +		       int __maxevents, int __timeout)
> +	__attr_access ((__write_only__, 2, 3));
>   
>   
>   /* Same as epoll_wait, but the thread's signal mask is temporarily
> @@ -132,7 +133,8 @@ extern int epoll_wait (int __epfd, struc
>      __THROW.  */
>   extern int epoll_pwait (int __epfd, struct epoll_event *__events,
>   			int __maxevents, int __timeout,
> -			const __sigset_t *__ss);
> +			const __sigset_t *__ss)
> +	__attr_access ((__write_only__, 2, 3));
>   
>   /* Same as epoll_pwait, but the timeout as a timespec.
>   
> @@ -141,14 +143,16 @@ extern int epoll_pwait (int __epfd, stru
>   #ifndef __USE_TIME_BITS64
>   extern int epoll_pwait2 (int __epfd, struct epoll_event *__events,
>   			 int __maxevents, const struct timespec *__timeout,
> -			 const __sigset_t *__ss);
> +			 const __sigset_t *__ss)
> +	__attr_access ((__write_only__, 2, 3));
>   #else
>   # ifdef __REDIRECT
>   extern int __REDIRECT (epoll_pwait2, (int __epfd, struct epoll_event *__ev,
>   				      int __maxevs,
>   				      const struct timespec *__timeout,
>   				      const __sigset_t *__ss),
> -		       __epoll_pwait2_time64);
> +		       __epoll_pwait2_time64)
> +	__attr_access ((__write_only__, 2, 3));
>   # else
>   #  define epoll_pwait2 __epoll_pwait2_time64
>   # endif
> 
> 
> 



More information about the Libc-alpha mailing list