cURL / Mailing Lists / curl-library / Single Mail


Problem building libcurl on AIX platforms

From: Rozita Mirzadeh <>
Date: Thu, 21 Feb 2013 21:43:43 +0000

I am trying to build libcurl on several platforms, and on AIX 5.1 and AIX 5.2, I get the following error:
libtool: compile: gcc -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -isystem /usr/local/krb5_so-1.3.3/include -isystem /usr/local/openssl_so-0.9.7j/include -I/usr/local/openssl_so-0.9.7j/include -I/usr/local/openssl_so-0.9.7j/include/openssl -Wall -DALLOW_CORE=Y -isystem /usr/local/krb5_so-1.3.3/include -isystem /usr/local/openssl_so-0.9.7j/include -O2 -Wno-system-headers -MT libcurl_la-multi.lo -MD -MP -MF .deps/libcurl_la-multi.Tpo -c multi.c -DPIC -o .libs/libcurl_la-multi.o
multi.c: In function `curl_multi_wait':
multi.c:1021: error: structure has no member named `reqevents'
multi.c:1022: error: structure has no member named `reqevents'
multi.c:1023: error: structure has no member named `reqevents'

The code in multi.c (lines 1021 to 1023) has the following:
  for(i = 0; i < extra_nfds; i++) {
    ufds[nfds].fd = extra_fds[i].fd;
    ufds[nfds].events = (short) (
      ((extra_fds[i].events & CURL_WAIT_POLLIN) ? POLLIN : 0) |
      ((extra_fds[i].events & CURL_WAIT_POLLPRI) ? POLLPRI : 0) |
      ((extra_fds[i].events & CURL_WAIT_POLLOUT) ? POLLOUT : 0) );

Where "extra_fds" is a pointer to the structure struct curl_waitfd extra_fds[], defined in multi.h as follow:
struct curl_waitfd {
  curl_socket_t fd;
  short events;
  short revents; /* not supported yet */

The compile error is due to including the file /usr/include/sys/poll.h with _ALL_SOURCE defined. In /usr/include/sys/poll.h, on AIX, we have:
#ifdef _ALL_SOURCE
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 "#define events reqevents" replaces "events" in the lines 1021, 1022, 1023 in multi.c to 'reqevents' and produces the error "structure has no member named reqevents".

The obvious resolution is to change the name of the members of the structure curl_waitfd from 'events' to some other name in multi.h and change the code in multi.c to reference the new name instead of 'event'. But I am just curious how is this issue not encountered by others, specially that it appears that 'configure' forces _ALL_SOURCE to be defined for AIX platforms, as if to ensure that the code will not compile on AIX.

Is there any other way of fixing this issue besides changing the code?

Thanks for your help.

Rosie Mirzadeh

List admin:
Received on 2013-02-21