aix: re-enable fs watch facility

On AIX, watch feature depends on AHAFS based Event infrastructure.
While in principle the watch use case is same across platforms, there
are subtle differences in the way AIX deals with this, with few
behavioral changes (external).

This commit opens up the AIX code for watch feature which was masked
under a macro HAVE_SYS_AHAFS_EVPRODS_H and addresses an assertion
failure on folder watch.

PR-URL: https://github.com/libuv/libuv/pull/1156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
Gireesh Punathil 2016-12-02 22:28:22 -05:00 committed by Santiago Gimeno
parent 12bfad9c6d
commit fb0f87b6d7
3 changed files with 13 additions and 1 deletions

View File

@ -316,7 +316,11 @@ test_run_tests_CFLAGS += -D_UNIX03_THREADS \
endif
if AIX
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT -D_THREAD_SAFE
libuv_la_CFLAGS += -D_ALL_SOURCE \
-D_XOPEN_SOURCE=500 \
-D_LINUX_SOURCE_COMPAT \
-D_THREAD_SAFE \
-DHAVE_SYS_AHAFS_EVPRODS_H
include_HEADERS += include/uv-aix.h
libuv_la_SOURCES += src/unix/aix.c
endif

View File

@ -758,6 +758,13 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int
assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file");
/* In file / directory move cases, AIX Event infrastructure
* produces a second event with no data.
* Ignore it and return gracefully.
*/
if(bytes == 0)
return;
/* Parse the data */
if(bytes > 0)
rc = uv__parse_data(result_data, &events, handle);

1
uv.gyp
View File

@ -277,6 +277,7 @@
'_XOPEN_SOURCE=500',
'_LINUX_SOURCE_COMPAT',
'_THREAD_SAFE',
'HAVE_SYS_AHAFS_EVPRODS_H',
],
'link_settings': {
'libraries': [