nonnull on epoll_wait(2) syscall wrappers?

Alejandro Colomar alx.manpages@gmail.com
Fri May 19 22:50:52 GMT 2023


Hi Adhemerval,

I was checking the epoll_pwait2(2) man page to see if it needs some
updating for the wrapper you added recently.  It seems all's good.

<https://sourceware.org/bugzilla/show_bug.cgi?id=27359>

However, I noticed that there's a difference between the current
manual page and the glibc wrappers for the 3 related functions:


$ grepc -x /sys/epoll.h$ epoll_wait /usr/include/
/usr/include/x86_64-linux-gnu/sys/epoll.h:124:
extern int epoll_wait (int __epfd, struct epoll_event *__events,
		       int __maxevents, int __timeout)
	__attr_access ((__write_only__, 2, 3));
$ grepc -x /sys/epoll.h$ epoll_pwait /usr/include/
/usr/include/x86_64-linux-gnu/sys/epoll.h:134:
extern int epoll_pwait (int __epfd, struct epoll_event *__events,
			int __maxevents, int __timeout,
			const __sigset_t *__ss)
	__attr_access ((__write_only__, 2, 3));
$ grepc -x /sys/epoll.h$ epoll_pwait2 /usr/include/
/usr/include/x86_64-linux-gnu/sys/epoll.h:144:
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));


/usr/include/x86_64-linux-gnu/sys/epoll.h:157:
#  define epoll_pwait2 __epoll_pwait2_time64


The man page synopsis is:


SYNOPSIS
       #include <sys/epoll.h>

       int epoll_wait(int epfd, struct epoll_event *events,
                      int maxevents, int timeout);
       int epoll_pwait(int epfd, struct epoll_event *events,
                      int maxevents, int timeout,
                      const sigset_t *_Nullable sigmask);
       int epoll_pwait2(int epfd, struct epoll_event *events,
                      int maxevents, const struct timespec *_Nullable timeout,
                      const sigset_t *_Nullable sigmask);


I didn't use _Nullable in the events parameter, because I don't think
it can be NULL.  Does it make any sense in any case having a NULL
there?  Should we use nonnull in glibc?

Cheers,
Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20230520/7e609bcf/attachment.sig>


More information about the Libc-alpha mailing list