You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by li...@apache.org on 2024/10/15 02:32:13 UTC
(nuttx-apps) branch master updated (8ed046e2d -> 9c51919a1)
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
from 8ed046e2d apps/benchmarks/dhrystone: Fix compilation errors
new 8b6e63c22 libuv: default select epoll backend in libuv
new 5891f7037 libuv:add inotify test for nuttx
new 4e386a955 system/libuv: optimize stack usage
new ed91a3c03 libuv:change LIBUV_BACKEND_EPOLL depends on FS_NOTIFY
new be85fab47 libuv:Make libuv use epoll runable without fsnotify
new 9c51919a1 libuv:add threadpool DEF_THREADPOOL_PRIORITY
The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
system/libuv/0001-libuv-port-for-nuttx.patch | 416 +++++++++++++++++++++++++++
system/libuv/CMakeLists.txt | 6 +-
system/libuv/Kconfig | 20 ++
system/libuv/Makefile | 9 +-
4 files changed, 448 insertions(+), 3 deletions(-)
(nuttx-apps) 04/06: libuv:change LIBUV_BACKEND_EPOLL depends on FS_NOTIFY
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit ed91a3c03cd4e36b8840e038eea907d060a0b30a
Author: guohao15 <gu...@xiaomi.com>
AuthorDate: Wed Nov 8 11:17:34 2023 +0800
libuv:change LIBUV_BACKEND_EPOLL depends on FS_NOTIFY
Signed-off-by: guohao15 <gu...@xiaomi.com>
---
system/libuv/Kconfig | 2 +-
system/libuv/Makefile | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig
index a28a87690..d8e3b0114 100644
--- a/system/libuv/Kconfig
+++ b/system/libuv/Kconfig
@@ -22,8 +22,8 @@ config LIBUV_THREAD_STACKSIZE
config LIBUV_BACKEND_EPOLL
bool "Using epoll backend in libuv"
- select FS_NOTIFY
default y
+ depends on FS_NOTIFY
if LIBUV_BACKEND_EPOLL
diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index 8914037f5..5500c6a0d 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -81,6 +81,7 @@ ifneq ($(CONFIG_LIBUV_BACKEND_EPOLL),)
CSRCS += linux.c
else
CSRCS += posix-poll.c
+CSRCS += no-fsevents.c
endif
CSRCS += uv-data-getter-setters.c
CSRCS += version.c
@@ -89,9 +90,6 @@ CSRCS += idna.c
CSRCS += strscpy.c
CSRCS += strtok.c
endif
-ifeq ($(CONFIG_FS_NOTIFY),)
-CSRCS += no-fsevents.c
-endif
CSRCS += uv-common.c
CSRCS += random-devurandom.c
CSRCS += random.c
(nuttx-apps) 02/06: libuv:add inotify test for nuttx
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 5891f7037bb2ebc05a3b1b484bb4d7f89aa06b47
Author: guohao15 <gu...@xiaomi.com>
AuthorDate: Thu Oct 19 20:14:02 2023 +0800
libuv:add inotify test for nuttx
Signed-off-by: guohao15 <gu...@xiaomi.com>
---
system/libuv/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index f8e753018..20e6e3f86 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -86,7 +86,9 @@ CSRCS += idna.c
CSRCS += strscpy.c
CSRCS += strtok.c
endif
+ifeq ($(CONFIG_FS_NOTIFY),)
CSRCS += no-fsevents.c
+endif
CSRCS += uv-common.c
CSRCS += random-devurandom.c
CSRCS += random.c
(nuttx-apps) 03/06: system/libuv: optimize stack usage
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 4e386a955e1fe1e42ea9ec24f550ea9a9c40a2b4
Author: guohao15 <gu...@xiaomi.com>
AuthorDate: Tue Nov 7 21:25:26 2023 +0800
system/libuv: optimize stack usage
Signed-off-by: guohao15 <gu...@xiaomi.com>
---
system/libuv/Kconfig | 12 ++++++++++++
system/libuv/Makefile | 3 +++
2 files changed, 15 insertions(+)
diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig
index 4070ae3d6..a28a87690 100644
--- a/system/libuv/Kconfig
+++ b/system/libuv/Kconfig
@@ -25,6 +25,18 @@ config LIBUV_BACKEND_EPOLL
select FS_NOTIFY
default y
+if LIBUV_BACKEND_EPOLL
+
+config LIBUV_MAX_EPOLL_EVENTS
+ int "libuv max epoll events"
+ default 64
+
+config LIBUV_PREP_EVENT_SIZE
+ int "libuv prep event size"
+ default 1
+
+endif
+
choice
prompt "libuv utils"
default LIBUV_UTILS_NONE
diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index 20e6e3f86..8914037f5 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -51,6 +51,9 @@ CFLAGS += -I$(LIBUV_UNPACK)/test
CFLAGS += -Wno-shadow
CFLAGS += -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
CFLAGS += -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE
+CFLAGS += -DDEF_THREADPOOL_PRIORITY=CONFIG_LIBUV_THREADPOOL_PRIORITY
+CFLAGS += -DMAX_EPOLL_EVENTS=CONFIG_LIBUV_MAX_EPOLL_EVENTS
+CFLAGS += -DPREP_EVENT_SIZE=CONFIG_LIBUV_PREP_EVENT_SIZE
ifeq ($(GCCVER),)
export GCCVER = $(shell $(CC) --version | grep gcc | sed -r 's/.* ([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
(nuttx-apps) 06/06: libuv:add threadpool DEF_THREADPOOL_PRIORITY
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 9c51919a1a2b63cc185b0ea94156911582e48ba0
Author: yinshengkai <yi...@xiaomi.com>
AuthorDate: Wed Sep 13 11:46:47 2023 +0800
libuv:add threadpool DEF_THREADPOOL_PRIORITY
Signed-off-by: yinshengkai <yi...@xiaomi.com>
---
system/libuv/CMakeLists.txt | 6 ++++--
system/libuv/Kconfig | 4 ++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/system/libuv/CMakeLists.txt b/system/libuv/CMakeLists.txt
index 205eeae7c..55375ad2b 100644
--- a/system/libuv/CMakeLists.txt
+++ b/system/libuv/CMakeLists.txt
@@ -55,8 +55,10 @@ if(CONFIG_LIBUV)
# Flags
# ############################################################################
- set(CFLAGS -Wno-shadow -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
- -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE)
+ set(CFLAGS
+ -Wno-shadow -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
+ -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE
+ -DDEF_THREADPOOL_PRIORITY=CONFIG_LIBUV_THREADPOOL_PRIORITY)
if(GCCVER EQUAL 12)
list(APPEND CFLAGS -Wno-dangling-pointer)
diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig
index dabe7dbf5..e0d18746a 100644
--- a/system/libuv/Kconfig
+++ b/system/libuv/Kconfig
@@ -20,6 +20,10 @@ config LIBUV_THREAD_STACKSIZE
int "libuv worker thread stack size"
default PTHREAD_STACK_DEFAULT
+config LIBUV_THREADPOOL_PRIORITY
+ int "libuv default thread pool priority"
+ default 100
+
config LIBUV_BACKEND_EPOLL
bool "Using epoll backend in libuv"
default y
(nuttx-apps) 05/06: libuv:Make libuv use epoll runable without fsnotify
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit be85fab47cbad7a6ba40ab09af1f5af41a87f04d
Author: guohao15 <gu...@xiaomi.com>
AuthorDate: Fri Mar 29 15:28:02 2024 +0800
libuv:Make libuv use epoll runable without fsnotify
Signed-off-by: guohao15 <gu...@xiaomi.com>
---
system/libuv/Kconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig
index d8e3b0114..dabe7dbf5 100644
--- a/system/libuv/Kconfig
+++ b/system/libuv/Kconfig
@@ -23,7 +23,6 @@ config LIBUV_THREAD_STACKSIZE
config LIBUV_BACKEND_EPOLL
bool "Using epoll backend in libuv"
default y
- depends on FS_NOTIFY
if LIBUV_BACKEND_EPOLL
(nuttx-apps) 01/06: libuv: default select epoll backend in libuv
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 8b6e63c22d2cf02547a0cb41a6ce280838bcdeba
Author: dongjiuzhu1 <do...@xiaomi.com>
AuthorDate: Wed Mar 29 22:25:12 2023 +0800
libuv: default select epoll backend in libuv
Signed-off-by: dongjiuzhu1 <do...@xiaomi.com>
---
system/libuv/0001-libuv-port-for-nuttx.patch | 416 +++++++++++++++++++++++++++
system/libuv/Kconfig | 5 +
system/libuv/Makefile | 4 +
3 files changed, 425 insertions(+)
diff --git a/system/libuv/0001-libuv-port-for-nuttx.patch b/system/libuv/0001-libuv-port-for-nuttx.patch
index 660ed880f..237ff58b6 100644
--- a/system/libuv/0001-libuv-port-for-nuttx.patch
+++ b/system/libuv/0001-libuv-port-for-nuttx.patch
@@ -3544,3 +3544,419 @@ index bbc0c305..4e7996f5 100644
MAKE_VALGRIND_HAPPY(loop);
return 0;
+diff --git a/include/uv/unix.h b/include/uv/unix.h
+index 4962b932..e6303c45 100644
+--- a/include/uv/unix.h
++++ b/include/uv/unix.h
+@@ -45,7 +45,7 @@
+
+ #include "uv/threadpool.h"
+
+-#if defined(__linux__)
++#if defined(__linux__) || defined(CONFIG_LIBUV_BACKEND_EPOLL)
+ # include "uv/linux.h"
+ #elif defined (__MVS__)
+ # include "uv/os390.h"
+diff --git a/src/unix/internal.h b/src/unix/internal.h
+index ddc744b2..7ff0c094 100644
+--- a/src/unix/internal.h
++++ b/src/unix/internal.h
+@@ -177,7 +177,7 @@ struct uv__stream_queued_fds_s {
+ int fds[1];
+ };
+
+-#ifdef __linux__
++#if defined(__linux__) || defined(__NuttX__)
+ struct uv__statx_timestamp {
+ int64_t tv_sec;
+ uint32_t tv_nsec;
+@@ -207,7 +207,7 @@ struct uv__statx {
+ uint32_t stx_dev_minor;
+ uint64_t unused1[14];
+ };
+-#endif /* __linux__ */
++#endif /* __linux__ || __NuttX__ */
+
+ #if defined(_AIX) || \
+ defined(__APPLE__) || \
+diff --git a/src/unix/linux.c b/src/unix/linux.c
+index 48b9c2c4..95f0e3dc 100644
+--- a/src/unix/linux.c
++++ b/src/unix/linux.c
+@@ -52,6 +52,7 @@
+ #include <time.h>
+ #include <unistd.h>
+
++#ifdef __linux__
+ #ifndef __NR_io_uring_setup
+ # define __NR_io_uring_setup 425
+ #endif
+@@ -63,6 +64,7 @@
+ #ifndef __NR_io_uring_register
+ # define __NR_io_uring_register 427
+ #endif
++#endif
+
+ #ifndef __NR_copy_file_range
+ # if defined(__x86_64__)
+@@ -335,6 +337,7 @@ unsigned uv__kernel_version(void) {
+ }
+
+
++#ifdef __linux__
+ ssize_t
+ uv__fs_copy_file_range(int fd_in,
+ off_t* off_in,
+@@ -389,10 +392,15 @@ ssize_t uv__getrandom(void* buf, size_t buflen, unsigned flags) {
+ return rc;
+ #endif
+ }
++#endif
+
+
+ int uv__io_uring_setup(int entries, struct uv__io_uring_params* params) {
++#ifdef __NR_io_uring_setup
+ return syscall(__NR_io_uring_setup, entries, params);
++#else
++ return errno = ENOSYS, -1;
++#endif
+ }
+
+
+@@ -404,6 +412,7 @@ int uv__io_uring_enter(int fd,
+ * in newer kernels unless IORING_ENTER_EXT_ARG is set,
+ * in which case it takes a struct io_uring_getevents_arg.
+ */
++#ifdef __NR_io_uring_enter
+ return syscall(__NR_io_uring_enter,
+ fd,
+ to_submit,
+@@ -411,16 +420,23 @@ int uv__io_uring_enter(int fd,
+ flags,
+ NULL,
+ 0L);
++#else
++ return errno = ENOSYS, -1;
++#endif
+ }
+
+
+ int uv__io_uring_register(int fd, unsigned opcode, void* arg, unsigned nargs) {
++#ifdef __NR_io_uring_register
+ return syscall(__NR_io_uring_register, fd, opcode, arg, nargs);
++#else
++ return errno = ENOSYS, -1;
++#endif
+ }
+
+
+ static int uv__use_io_uring(void) {
+-#if defined(__ANDROID_API__)
++#if defined(__ANDROID_API__) || defined(__NuttX__)
+ return 0; /* Possibly available but blocked by seccomp. */
+ #else
+ /* Ternary: unknown=0, yes=1, no=-1 */
+@@ -695,7 +711,7 @@ int uv__io_check_fd(uv_loop_t* loop, int fd) {
+ return rc;
+ }
+
+-
++#ifdef __linux__
+ /* Caller must initialize SQE and call uv__iou_submit(). */
+ static struct uv__io_uring_sqe* uv__iou_get_sqe(struct uv__iou* iou,
+ uv_loop_t* loop,
+@@ -1019,6 +1035,7 @@ int uv__iou_fs_statx(uv_loop_t* loop,
+
+ return 1;
+ }
++#endif
+
+
+ void uv__statx_to_stat(const struct uv__statx* statxbuf, uv_stat_t* buf) {
+@@ -1530,6 +1547,7 @@ update_timeout:
+ uv__epoll_ctl_flush(epollfd, ctl, &prep);
+ }
+
++#ifdef __linux__
+ uint64_t uv__hrtime(uv_clocktype_t type) {
+ static _Atomic clock_t fast_clock_id = -1;
+ struct timespec t;
+@@ -2238,6 +2256,7 @@ void uv_loadavg(double avg[3]) {
+ avg[1] = (double) info.loads[1] / 65536.0;
+ avg[2] = (double) info.loads[2] / 65536.0;
+ }
++#endif
+
+
+ static int compare_watchers(const struct watcher_list* a,
+diff --git a/src/uv-common.h b/src/uv-common.h
+index cd57e5a3..7bd628e8 100644
+--- a/src/uv-common.h
++++ b/src/uv-common.h
+@@ -396,7 +396,7 @@ struct uv__loop_metrics_s {
+ void uv__metrics_update_idle_time(uv_loop_t* loop);
+ void uv__metrics_set_provider_entry_time(uv_loop_t* loop);
+
+-#ifdef __linux__
++#if defined(__linux__) || defined(CONFIG_LIBUV_BACKEND_EPOLL)
+ struct uv__iou {
+ uint32_t* sqhead;
+ uint32_t* sqtail;
+@@ -417,17 +417,17 @@ struct uv__iou {
+ uint32_t in_flight;
+ uint32_t flags;
+ };
+-#endif /* __linux__ */
++#endif /* __linux__ || CONFIG_LIBUV_BACKEND_EPOLL */
+
+ struct uv__loop_internal_fields_s {
+ unsigned int flags;
+ uv__loop_metrics_t loop_metrics;
+ int current_timeout;
+-#ifdef __linux__
++#if defined(__linux__) || defined(CONFIG_LIBUV_BACKEND_EPOLL)
+ struct uv__iou ctl;
+ struct uv__iou iou;
+ void* inv; /* used by uv__platform_invalidate_fd() */
+-#endif /* __linux__ */
++#endif /* __linux__ || CONFIG_LIBUV_BACKEND_EPOLL */
+ };
+
+ #endif /* UV_COMMON_H_ */
+diff --git a/test/task.h b/test/task.h
+index 25af255c..4162476a 100644
+--- a/test/task.h
++++ b/test/task.h
+@@ -353,7 +353,7 @@ UNUSED static int can_ipv6(void) {
+ return supported;
+ }
+
+-#if defined(__CYGWIN__) || defined(__MSYS__) || defined(__PASE__) || defined(__NuttX__)
++#if defined(__CYGWIN__) || defined(__MSYS__) || defined(__PASE__)
+ # define NO_FS_EVENTS "Filesystem watching not supported on this platform."
+ #endif
+
+diff --git a/test/test-fs-event.c b/test/test-fs-event.c
+index 9f231ebf..a1680989 100644
+--- a/test/test-fs-event.c
++++ b/test/test-fs-event.c
+@@ -405,6 +405,11 @@ TEST_IMPL(fs_event_watch_dir) {
+ uv_loop_t* loop = uv_default_loop();
+ int r;
+
++ fs_event_cb_called = 0;
++ fs_event_created = 0;
++ fs_event_removed = 0;
++ close_cb_called = 0;
++
+ /* Setup */
+ fs_event_unlink_files(NULL);
+ remove("watch_dir/file2");
+@@ -443,6 +448,12 @@ TEST_IMPL(fs_event_watch_dir_recursive) {
+ int r;
+ uv_fs_event_t fs_event_root;
+
++ fs_multievent_cb_called = 0;
++ fs_event_cb_called = 0;
++ fs_event_created = 0;
++ fs_event_removed = 0;
++ close_cb_called = 0;
++
+ /* Setup */
+ loop = uv_default_loop();
+ fs_event_unlink_files(NULL);
+@@ -558,6 +569,9 @@ TEST_IMPL(fs_event_watch_file) {
+
+ uv_loop_t* loop = uv_default_loop();
+ int r;
++ fs_event_cb_called = 0;
++ timer_cb_called = 0;
++ close_cb_called = 0;
+
+ /* Setup */
+ remove("watch_dir/file2");
+@@ -605,6 +619,7 @@ TEST_IMPL(fs_event_watch_file_exact_path) {
+ int r;
+
+ loop = uv_default_loop();
++ timer_cb_exact_called = 0;
+
+ /* Setup */
+ remove("watch_dir/file.js");
+@@ -653,6 +668,10 @@ TEST_IMPL(fs_event_watch_file_twice) {
+ uv_timer_t timer;
+ uv_loop_t* loop;
+
++ create_dir("test/");
++ create_dir("test/fixtures/");
++ create_file("test/fixtures/empty_file");
++
+ loop = uv_default_loop();
+ timer.data = watchers;
+
+@@ -664,6 +683,10 @@ TEST_IMPL(fs_event_watch_file_twice) {
+ ASSERT(0 == uv_timer_start(&timer, timer_cb_watch_twice, 10, 0));
+ ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
+
++ remove("test/fixtures/empty_file");
++ remove("test/fixtures/");
++ remove("test/");
++
+ MAKE_VALGRIND_HAPPY(loop);
+ return 0;
+ }
+@@ -677,6 +700,9 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
+ int r;
+
+ loop = uv_default_loop();
++ timer_cb_touch_called = 0;
++ fs_event_cb_called = 0;
++ close_cb_called = 0;
+
+ /* Setup */
+ remove("watch_file");
+@@ -758,6 +784,9 @@ TEST_IMPL(fs_event_no_callback_after_close) {
+ uv_loop_t* loop = uv_default_loop();
+ int r;
+
++ fs_event_cb_called = 0;
++ close_cb_called = 0;
++
+ /* Setup */
+ remove("watch_dir/file1");
+ remove("watch_dir/");
+@@ -796,6 +825,9 @@ TEST_IMPL(fs_event_no_callback_on_close) {
+ uv_loop_t* loop = uv_default_loop();
+ int r;
+
++ fs_event_cb_called = 0;
++ close_cb_called = 0;
++
+ /* Setup */
+ remove("watch_dir/file1");
+ remove("watch_dir/");
+@@ -848,6 +880,7 @@ TEST_IMPL(fs_event_immediate_close) {
+ int r;
+
+ loop = uv_default_loop();
++ close_cb_called = 0;
+
+ r = uv_timer_init(loop, &timer);
+ ASSERT(r == 0);
+@@ -873,6 +906,8 @@ TEST_IMPL(fs_event_close_with_pending_event) {
+
+ loop = uv_default_loop();
+
++ close_cb_called = 0;
++
+ create_dir("watch_dir");
+ create_file("watch_dir/file");
+
+@@ -946,6 +981,9 @@ TEST_IMPL(fs_event_close_in_callback) {
+ int r;
+
+ loop = uv_default_loop();
++ close_cb_called = 0;
++ fs_event_cb_called = 0;
++ fs_event_created = 0;
+
+ fs_event_unlink_files(NULL);
+ create_dir("watch_dir");
+@@ -987,6 +1025,7 @@ TEST_IMPL(fs_event_start_and_close) {
+ int r;
+
+ loop = uv_default_loop();
++ close_cb_called = 0;
+
+ create_dir("watch_dir");
+
+@@ -1031,6 +1070,7 @@ TEST_IMPL(fs_event_getpath) {
+
+ create_dir("watch_dir");
+ create_dir("watch_dir/subfolder");
++ close_cb_called = 0;
+
+
+ for (i = 0; i < ARRAY_SIZE(watch_dir); i++) {
+@@ -1097,6 +1137,8 @@ TEST_IMPL(fs_event_error_reporting) {
+ uv_loop_t* loop;
+ uv_fs_event_t* event;
+
++ fs_event_error_reported = 0;
++
+ TEST_FILE_LIMIT(ARRAY_SIZE(loops) * 3);
+
+ remove("watch_dir/");
+diff --git a/test/test-fs-event.c b/test/test-fs-event.c
+index a1680989..ab7b5941 100644
+--- a/test/test-fs-event.c
++++ b/test/test-fs-event.c
+@@ -668,8 +668,8 @@ TEST_IMPL(fs_event_watch_file_twice) {
+ uv_timer_t timer;
+ uv_loop_t* loop;
+
+- create_dir("test/");
+- create_dir("test/fixtures/");
++ create_dir("test");
++ create_dir("test/fixtures");
+ create_file("test/fixtures/empty_file");
+
+ loop = uv_default_loop();
+@@ -684,8 +684,8 @@ TEST_IMPL(fs_event_watch_file_twice) {
+ ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
+
+ remove("test/fixtures/empty_file");
+- remove("test/fixtures/");
+- remove("test/");
++ remove("test/fixtures");
++ remove("test");
+
+ MAKE_VALGRIND_HAPPY(loop);
+ return 0;
+@@ -941,6 +941,7 @@ TEST_IMPL(fs_event_close_with_pending_delete_event) {
+ int r;
+
+ loop = uv_default_loop();
++ close_cb_called = 0;
+
+ create_dir("watch_dir");
+ create_file("watch_dir/file");
+@@ -1240,6 +1241,8 @@ TEST_IMPL(fs_event_stop_in_cb) {
+ uv_fs_event_t fs;
+ uv_timer_t timer;
+ char path[] = "fs_event_stop_in_cb.txt";
++ timer_cb_touch_called = 0;
++ fs_event_cb_stop_calls = 0;
+
+ #if defined(NO_FS_EVENTS)
+ RETURN_SKIP(NO_FS_EVENTS);
+diff --git a/src/unix/nuttx.c b/src/unix/nuttx.c
+index 57afeb2c..ec8eeb08 100644
+--- a/src/unix/nuttx.c
++++ b/src/unix/nuttx.c
+@@ -360,3 +360,25 @@ uv__global_t* uv__global_get(void) {
+ ASSERT(global != NULL);
+ return global;
+ }
++
++#ifndef CONFIG_FS_NOTIFY
++int inotify_init(void)
++{
++ return UV_ENOTSUP;
++}
++
++int inotify_init1(int flags)
++{
++ return UV_ENOTSUP;
++}
++
++int inotify_add_watch(int fd, FAR const char *pathname, uint32_t mask)
++{
++ return UV_ENOTSUP;
++}
++
++int inotify_rm_watch(int fd, int wd)
++{
++ return UV_ENOTSUP;
++}
++#endif
diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig
index 56f30bc90..4070ae3d6 100644
--- a/system/libuv/Kconfig
+++ b/system/libuv/Kconfig
@@ -20,6 +20,11 @@ config LIBUV_THREAD_STACKSIZE
int "libuv worker thread stack size"
default PTHREAD_STACK_DEFAULT
+config LIBUV_BACKEND_EPOLL
+ bool "Using epoll backend in libuv"
+ select FS_NOTIFY
+ default y
+
choice
prompt "libuv utils"
default LIBUV_UTILS_NONE
diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index bb2b50bcc..f8e753018 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -74,7 +74,11 @@ CSRCS += loop.c
CSRCS += thread.c
CSRCS += thread-common.c
CSRCS += posix-hrtime.c
+ifneq ($(CONFIG_LIBUV_BACKEND_EPOLL),)
+CSRCS += linux.c
+else
CSRCS += posix-poll.c
+endif
CSRCS += uv-data-getter-setters.c
CSRCS += version.c
ifeq ($(CONFIG_LIBUV_UTILS_TEST),)