diff --git a/docs/src/poll.rst b/docs/src/poll.rst index 69d45be6..004ff4b9 100644 --- a/docs/src/poll.rst +++ b/docs/src/poll.rst @@ -31,6 +31,8 @@ closed immediately after a call to :c:func:`uv_poll_stop` or :c:func:`uv_close`. On windows only sockets can be polled with poll handles. On Unix any file descriptor that would be accepted by :man:`poll(2)` can be used. +.. note:: + On AIX, watching for disconnection is not supported. Data types ---------- @@ -101,6 +103,10 @@ API Calling :c:func:`uv_poll_start` on a handle that is already active is fine. Doing so will update the events mask that is being watched for. + .. note:: + Though UV_DISCONNECT can be set, it is unsupported on AIX and as such will not be set + on the `events` field in the callback. + .. versionchanged:: 1.9.0 Added the UV_DISCONNECT event. .. c:function:: int uv_poll_stop(uv_poll_t* poll) diff --git a/test/test-poll.c b/test/test-poll.c index bfb75af1..f3cfe797 100644 --- a/test/test-poll.c +++ b/test/test-poll.c @@ -72,8 +72,9 @@ static int closed_connections = 0; static int valid_writable_wakeups = 0; static int spurious_writable_wakeups = 0; +#ifndef _AIX static int disconnects = 0; - +#endif /* !_AIX */ static int got_eagain(void) { #ifdef _WIN32 @@ -377,7 +378,7 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { new_events &= ~UV_WRITABLE; } } - +#ifndef _AIX if (events & UV_DISCONNECT) { context->got_disconnect = 1; ++disconnects; @@ -385,6 +386,9 @@ static void connection_poll_cb(uv_poll_t* handle, int status, int events) { } if (context->got_fin && context->sent_fin && context->got_disconnect) { +#else /* _AIX */ + if (context->got_fin && context->sent_fin) { +#endif /* !_AIx */ /* Sent and received FIN. Close and destroy context. */ close_socket(context->sock); destroy_connection_context(context); @@ -552,8 +556,9 @@ static void start_poll_test(void) { spurious_writable_wakeups > 20); ASSERT(closed_connections == NUM_CLIENTS * 2); +#ifndef _AIX ASSERT(disconnects == NUM_CLIENTS * 2); - +#endif MAKE_VALGRIND_HAPPY(); }