apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject RE: cvs commit: apr/support/unix waitio.c
Date Thu, 11 Jul 2002 16:29:24 GMT

> On 11 Jul 2002 trawick@apache.org wrote:
>
> > trawick     2002/07/11 07:39:04
> >
> >   Modified:    include  apr_poll.h
> >                poll/unix poll.c
> >                support/unix waitio.c
> >   Log:
> >   get the new poll code to build on AIX, which for 32-bit
> builds has some
> >   extremely unfortunate macros in <sys/poll.h> that play with
> "events" and
> >   "revents" via #define
>
> Can I just say how completely and utterly BOGUS that is.  Somebody should
> really talk to the AIX C run-time team and let them know that it is
> completely insane that they have that code in their public header files.
>
> Ryan

Yep, it's bogus allright.  I wouldn't be suprised if this problem exists on
other OSes though... here is the offending code from
/usr/include/sys/poll.h...

#ifdef  __64BIT__
/* pollfd.fd is always a 32 bit entity (XOPEN) */
struct	pollfd
{
	int	fd;			/* file descriptor or file ptr	*/
	short	events;			/* requested events		*/
	short	revents;		/* returned events		*/

};
#else /* __64BIT__ */
struct	pollfd
{
	long	fd;			/* file descriptor or file ptr	*/
	ushort	reqevents;		/* requested events		*/
	ushort	rtnevents;		/* returned events		*/
};
#define	events	reqevents		/* SVR3,4 pollfd member name	*/
#define	revents	rtnevents		/* SVR3,4 pollfd member name	*/
#endif /* __64BIT__ */

The comments beside the #defines are telling...

Bill


Mime
View raw message