httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: [PATCH] Compiler warning + 64-bit AIX cleanup in dexter mpm
Date Thu, 22 Jun 2000 00:31:29 GMT
> From:
> Date: Wed, 21 Jun 2000 16:40:15 -0700 (PDT)
> Couldn't this entire patch be avoided by just defining ap_os_sock_t to be
> a long on 64-bit AIX?  

not sure...  even if so, I'd hate to use more storage and more
instructions everywhere just to avoid an idiosyncrasy in struct

>                              Or, are you saying that file descriptors have
> different sizes in difference cases on 64-bit AIX.  

File descriptors are always int in AIX as far as we could tell.  The
fd field in struct pollfd is larger than int because it needs to be
able to hold things that are larger than file descriptors.

>                                                    I hate to change this
> code just because AIX has a broken implementation.  Single Unix defines
> pollfd.fd to be an int.  It makes little sense to me for it to be a long,
> but I guess AIX developers just like to make life difficult.  :-(

Yes, it is unfortunate :(  

> Having looked at the AIX API, it looks like they are overloading the poll
> API to allow the first argument to be a pointer to either a pollfd, a
> pollmsg, or a pollist.  Ugggh.

We looked at the fd field in struct fd in sys/poll.h to understand why
it was not int and the comment said something like "file descriptor or
file offset".  I see that they didn't mention this little detail in
the manual I just found on-line.  Maybe the change is with 4.3.3...

> I would like to understand if AIX is making all of their fd's longs, or
> just the ones in the pollfd structure.  I have been unable to find this on
> the web anywhere.

I think it is just that this fd field is overloaded.

> I have one suggestion that I would also like to try to remove this
> problem.  I would be interested in seeing if we have the same problem if
> we use select instead of poll.  

We wouldn't have the problem with select().

>                                   If not, we can make dexter use ap_poll
> instead of poll, and then make APR decide to use select on 64-bit
> AIX.  

1) ap_poll() is slower than poll() and dexter doesn't need the
   portability that ap_poll() gives it

   I'd rather have the several extra lines of code in dexter than the
   extra pathlength requierd for ap_poll().  The few extra lines of
   code are unfortunate, of course, but at least they are much easier
   to verify than the code required to convert to ap_poll().

2) ap_poll() can use poll() on AIX with no such problem because APR
   never takes the address of the poll() field and treats it as a ptr
   to an int file descriptor

>                                                                      I
> get the feeling that this problem is going to bite us over and over again
> if we use the proposed patch.

I think there are only two callers of the poll() system call in in all
of Unix-land: ap_poll() and dexter.  More could be added, of course,
but that seems unlikely with ap_poll().

Jeff Trawick | | PGP public key at web site:
          Born in Roswell... married an alien...

View raw message