]> Savannah Git Hosting - gnulib.git/commitdiff
sys_select-h: Update for POSIX:2024.
authorBruno Haible <bruno@clisp.org>
Wed, 8 Jan 2025 21:24:13 +0000 (22:24 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 8 Jan 2025 21:24:13 +0000 (22:24 +0100)
* 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 *'.

ChangeLog
lib/sys_select.in.h
tests/test-sys_select-h.c

index b7c964d776be4eb64069952916834816fe8faf70..f19baf6d87524cb52848451cfde126e11cb3fcc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-01-08  Bruno Haible  <bruno@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 *'.
+
 2025-01-08  Bruno Haible  <bruno@clisp.org>
 
        doc: Document the previous change.
index fd3e28fd8e012b401a9a5a7260215a28cf57ac1d..f55687b5717e669127b57c46d813155e25f386b5 100644 (file)
 /* 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)
index 2d70fcb0e333b7a705cbd9de0db4f017c7bf604f..08aa83e000f64c124b39f734fadafa603ed082b2 100644 (file)
@@ -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 *));