From 39685a37f6e2ee6b4329da607a30073f466d2262 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 26 Dec 2021 12:46:40 +0100 Subject: [PATCH] pselect: Fix compilation error in C++ mode on AIX 7. * lib/sys_select.in.h (pselect): Use _GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS. * doc/posix-functions/pselect.texi: Mention the AIX problem. --- ChangeLog | 7 +++++++ doc/posix-functions/pselect.texi | 3 +++ lib/sys_select.in.h | 10 +++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54b3a3548f..153e36296d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-12-26 Bruno Haible + + pselect: Fix compilation error in C++ mode on AIX 7. + * lib/sys_select.in.h (pselect): Use _GL_CXXALIAS_SYS_CAST instead of + _GL_CXXALIAS_SYS. + * doc/posix-functions/pselect.texi: Mention the AIX problem. + 2021-12-25 Bruno Haible gnulib-tool: Fix handling of module libtextstyle-optional. diff --git a/doc/posix-functions/pselect.texi b/doc/posix-functions/pselect.texi index ce26c1688a..83323e5c5e 100644 --- a/doc/posix-functions/pselect.texi +++ b/doc/posix-functions/pselect.texi @@ -20,6 +20,9 @@ FreeBSD 8.2. Portability problems not fixed by Gnulib: @itemize @item +This function has a slightly incompatible declaration on some platforms: +AIX 7.1 (when @code{_ALL_SOURCE} is defined). +@item When the @var{sigmask} argument is nonnull on platforms that do not natively support this function, race conditions are possible when its gnulib implementation temporarily modifies the signal mask, and the diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 910bea5d12..e95e7e77c8 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -279,9 +279,13 @@ _GL_FUNCDECL_SYS (pselect, int, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, struct timespec const *restrict, const sigset_t *restrict)); # endif -_GL_CXXALIAS_SYS (pselect, int, - (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, - struct timespec const *restrict, const sigset_t *restrict)); +/* Need to cast, because on AIX 7, the second, third, fourth argument may be + void *restrict, void *restrict, void *restrict. */ +_GL_CXXALIAS_SYS_CAST (pselect, int, + (int, + fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, + const sigset_t *restrict)); # endif _GL_CXXALIASWARN (pselect); #elif defined GNULIB_POSIXCHECK -- 2.39.5