# HG changeset patch # User nickg # Date 1037058920 0 # Node ID dbc601e76824f6a93b383f61df8fed4eb4749857 # Parent 74f0dcfdc16633b8c685a410eab13b21de37b336 * include/sys/types.h: Add define/undefine for __NEED_FD_SETS_ONLY around include of sys/select.h to avoid circular dependencies in headers. * include/sys/select.h: Reorganized definitions so that the include from sys/types.h only defines the fd_set type and macros and not the select() and pselect() functions. The latter needs sigset_t from signal.h, which can result in circularity. diff --git a/packages/isoinfra/current/ChangeLog b/packages/isoinfra/current/ChangeLog --- a/packages/isoinfra/current/ChangeLog +++ b/packages/isoinfra/current/ChangeLog @@ -1,3 +1,14 @@ +2002-11-10 Nick Garnett + + * include/sys/types.h: Add define/undefine for __NEED_FD_SETS_ONLY + around include of sys/select.h to avoid circular dependencies in + headers. + + * include/sys/select.h: Reorganized definitions so that the + include from sys/types.h only defines the fd_set type and macros + and not the select() and pselect() functions. The latter needs + sigset_t from signal.h, which can result in circularity. + 2002-04-09 Jonathan Larmour * include/stdlib.h: use NORET attributes from cyg_type.h. diff --git a/packages/isoinfra/current/include/sys/select.h b/packages/isoinfra/current/include/sys/select.h --- a/packages/isoinfra/current/include/sys/select.h +++ b/packages/isoinfra/current/include/sys/select.h @@ -1,5 +1,3 @@ -#ifndef CYGONCE_ISO_SYS_SELECT_H -#define CYGONCE_ISO_SYS_SELECT_H /*======================================================================== // // sys/select.h @@ -11,6 +9,7 @@ // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2002 Nick Garnett // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -60,7 +59,6 @@ #include /* Configuration header */ - /* ------------------------------------------------------------------- */ #if !defined(_POSIX_SOURCE) @@ -70,6 +68,9 @@ # include CYGBLD_ISO_SELECT_HEADER # else +# ifndef CYGONCE_ISO_SYS_SELECT_FD_SETS +# define CYGONCE_ISO_SYS_SELECT_FD_SETS + #define NBBY 8 /* number of bits in a byte */ /* @@ -111,23 +112,45 @@ typedef struct fd_set { (__p)->fds_bits[_i] = 0; \ } -# ifdef __cplusplus +# endif /* CYGONCE_ISO_SYS_SELECT_FD_SETS */ + +# ifndef __NEED_FD_SETS_ONLY + +# ifndef CYGONCE_ISO_SYS_SELECT_H +# define CYGONCE_ISO_SYS_SELECT_H + +#include + +# ifdef __cplusplus extern "C" { -# endif +# endif struct timeval; extern int select( int /* nfd */, fd_set * /* in */, fd_set * /* out */, fd_set * /* ex */, struct timeval * /* tv */ ); - -# ifdef __cplusplus + +#ifdef CYGPKG_POSIX +struct timespec; +extern int +pselect( int /* nfd */, fd_set * /* in */, fd_set * /* out */, + fd_set * /* ex */, const struct timespec * /* ts */, + const sigset_t * /* mask */); +#endif + +# ifdef __cplusplus } /* extern "C" */ -# endif +# endif + +# endif /* CYGONCE_ISO_SYS_SELECT_H multiple inclusion protection */ + +# endif /* __NEED_FD_SETS_ONLY */ + # endif #endif + #endif /* if !defined(_POSIX_SOURCE) */ /* ------------------------------------------------------------------- */ -#endif /* CYGONCE_ISO_SYS_SELECT_H multiple inclusion protection */ /* EOF sys/select.h */ diff --git a/packages/isoinfra/current/include/sys/types.h b/packages/isoinfra/current/include/sys/types.h --- a/packages/isoinfra/current/include/sys/types.h +++ b/packages/isoinfra/current/include/sys/types.h @@ -11,6 +11,7 @@ // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. +// Copyright (C) 2002 Nick Garnett // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -101,7 +102,9 @@ typedef int pid_t; #endif /* Include for backward compatibility for now */ +#define __NEED_FD_SETS_ONLY #include +#undef __NEED_FD_SETS_ONLY #if !defined(_POSIX_SOURCE) # if CYGINT_ISO_BSDTYPES