POSIX:2024 specifies a small change in <sys/select.h>:
<https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_select.h.html>


2025-01-08  Bruno Haible  <br...@clisp.org>

        sys_select-h: Update for POSIX:2024.
        * lib/sys_select.in.h (rpl_fd_isset): Change type of second parameter to
        'const fd_set *'.
        * tests/test-sys_select-h.c: Check for some more types and for
        FD_SETSIZE.
        (FD_ISSET): Expect type of second parameter to be 'const fd_set *'.

diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index fd3e28fd8e..f55687b571 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -170,7 +170,7 @@
 /* Re-define FD_ISSET to avoid a WSA call while we are not using
    network sockets.  */
 static int
-rpl_fd_isset (SOCKET fd, fd_set * set)
+rpl_fd_isset (SOCKET fd, const fd_set * set)
 {
   u_int i;
   if (set == NULL)
diff --git a/tests/test-sys_select-h.c b/tests/test-sys_select-h.c
index 2d70fcb0e3..08aa83e000 100644
--- a/tests/test-sys_select-h.c
+++ b/tests/test-sys_select-h.c
@@ -18,6 +18,7 @@
 
 #include <config.h>
 
+/* Specification.  */
 #include <sys/select.h>
 
 /* Check that the 'struct timeval' type is defined.  */
@@ -30,6 +31,21 @@ typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof 
(a.tv_sec) ? 1 : -1];
 /* Check that sigset_t is defined.  */
 sigset_t t2;
 
+/* Check that time_t, suseconds_t are defined.  */
+time_t t3;
+suseconds_t t4;
+
+/* Check that the 'struct timespec' type is defined.  */
+struct timespec t5;
+
+/* Check that the 'fd_set' type is defined.  */
+fd_set t6;
+
+/* Check that FD_SETSIZE is defined.  */
+#if !FD_SETSIZE
+# error "FD_SETSIZE not positive"
+#endif
+
 #include "signature.h"
 
 /* The following may be macros without underlying functions, so only
@@ -38,7 +54,7 @@ sigset_t t2;
 SIGNATURE_CHECK (FD_CLR, void, (int, fd_set *));
 #endif
 #ifndef FD_ISSET
-SIGNATURE_CHECK (FD_ISSET, void, (int, fd_set *));
+SIGNATURE_CHECK (FD_ISSET, void, (int, const fd_set *));
 #endif
 #ifndef FD_SET
 SIGNATURE_CHECK (FD_SET, int, (int, fd_set *));




Reply via email to