compiling /usr/gnu/src/ruby-2.0.0-p0/thread.c
/usr/gnu/src/ruby-2.0.0-p0/thread.c: In function 'thread_start_func_2':
/usr/gnu/src/ruby-2.0.0-p0/thread.c:496:6: error: 'rb_hook_list_t' has no member named 'reqevents'
/usr/gnu/src/ruby-2.0.0-p0/thread.c:496:6: error: 'rb_hook_list_t' has no member named 'reqevents'
/usr/gnu/src/ruby-2.0.0-p0/thread.c:496:6: error: 'rb_hook_list_t' has no member named 'reqevents'
/usr/gnu/src/ruby-2.0.0-p0/thread.c:496:6: error: 'rb_hook_list_t' has no member named 'reqevents'
/usr/gnu/src/ruby-2.0.0-p0/thread.c: In function 'rb_threadptr_execute_interrupts':
/usr/gnu/src/ruby-2.0.0-p0/thread.c:1917:6: error: 'rb_hook_list_t' has no member named 'reqevents'
/usr/gnu/src/ruby-2.0.0-p0/thread.c:1917:6: error: 'rb_hook_list_t' has no member named 'reqevents'
Because Ruby only uses fd member revents, one option is to change include/ruby/io.h
I do not know why the documentation page that you referenced does not mention "events". The same header also exists in AIX 6.1, and probably earlier. It may have been removed in some update, but that does not address existing systems.
Ruby thread.c uses revents:
if (fds.revents & POLLIN_SET)
result |= RB_WAITFD_IN;
if (fds.revents & POLLOUT_SET)
result |= RB_WAITFD_OUT;
if (fds.revents & POLLEX_SET)
result |= RB_WAITFD_PRI;
so your patch causes the statements to refer to the wrong members. It seems safer to #undef the offending macro instead of defining more macros. Wrapping it in #ifdef _AIX is fine.
=begin
I could reproduce the error by copying system ((%sys/poll.h%)) header to
((%include/poll.h%)) with editing like the AIX header. And by adding these
two lines just before (({#include <poll.h>})) line in ((%include/ruby/io.h%)), it
builds fine.
Sorry Nakada-san. I misinterpreted your proposed fix. Yes, inserting those definitions before including poll.h allows thread.c to compile successfully.
This issue was solved with changeset r39987.
David, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
ruby/io.h: get rid of conflict on AIX
include/ruby/io.h: rename SVR3,4 member names as POSIX compliants,
to get rid of conflict on AIX. [ruby-core:53765] [Bug #8174]
Your original patch redefined the identifiers throughout the entire file. The committed patch exchanges some names within poll.h but does not satisfy identifiers used within thread.c
With the original proposed patch, thread.i looks like:
This issue was solved with changeset r39993.
David, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
ruby/io.h: get rid of conflict on AIX
include/ruby/io.h: undef POSIX compliants names on AIX, which are no
longer needed. patch suggested by edelsohn (David Edelsohn) in [ruby-core:53815]. [Bug #8174]
This issue was solved with changeset r40292.
David, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
* include/ruby/io.h: rename SVR3,4 member names as POSIX compliants,
to get rid of conflict on AIX. [ruby-core:53765] [Bug #8174]
* include/ruby/io.h: undef POSIX compliants names on AIX, which are no
longer needed. patch suggested by edelsohn (David Edelsohn) in
[ruby-core:53815]. [Bug #8174]
* include/ruby/io.h: undef POSIX compliant names on AIX, which are no
* include/ruby/io.h: rename SVR3,4 member names as POSIX compliant,