Mercurial > gnulib
diff lib/sys_select.in.h @ 15329:e121c7cef4a9
pselect: new module
* lib/sys_select.in.h: Include <signal.h>, for 'sigset_t'.
(pselect): New decls.
* m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Require AC_C_RESTRICT,
since the standard pselect decl uses 'restrict'.
(gl_SYS_SELECT_H_DEFAULTS): Add defaults for GNULIB_PSELECT,
HAVE_PSELECT, REPLACE_PSELECT.
* modules/sys_select (sys/select.h): Substitute GNULIB_PSELECT,
HAVE_PSELECT, REPLACE_PSELECT.
* lib/pselect.c, m4/pselect.m4, modules/pselect: New files.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 30 Jun 2011 14:57:39 -0700 |
parents | c7ae1577bd26 |
children | f61aaaf49e43 |
line wrap: on
line diff
--- a/lib/sys_select.in.h Thu Jun 30 10:58:24 2011 -0700 +++ b/lib/sys_select.in.h Thu Jun 30 14:57:39 2011 -0700 @@ -85,11 +85,48 @@ # endif #endif +/* Get definition of 'sigset_t'. + But avoid namespace pollution on glibc systems. */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include <signal.h> +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ +#if @GNULIB_PSELECT@ +# if @REPLACE_PSELECT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pselect +# define pselect rpl_pselect +# endif +_GL_FUNCDECL_RPL (pselect, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, const sigset_t *restrict)); +_GL_CXXALIAS_RPL (pselect, int, + (int, fd_set *restrict, fd_set *restrict, fd_set *restrict, + struct timespec const *restrict, const sigset_t *restrict)); +# else +# if !@HAVE_PSELECT@ +_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)); +# endif +_GL_CXXALIASWARN (pselect); +#elif defined GNULIB_POSIXCHECK +# undef pselect +# if HAVE_RAW_DECL_PSELECT +_GL_WARN_ON_USE (pselect, "pselect is not portable - " + "use gnulib module pselect for portability"); +# endif +#endif + #if @GNULIB_SELECT@ # if @REPLACE_SELECT@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE)