ioselectors_epoll: for NuttX, limit initial numFD to configured value. (#21421)

ioselectors: ioselectors_epoll: for NuttX, limit initial numFD to configured value.

In the NuttX build config, there is a setting called "FS_NEPOLL_DESCRIPTORS".

--------
config FS_NEPOLL_DESCRIPTORS
	int "Maximum number of default epoll descriptors for epoll_create1(2)"
	default 8
	---help---
		The maximum number of default epoll descriptors for epoll_create1(2)
--------

For NuttX, change the number of fd arrays allocated by newSelector() to that value.

Signed-off-by: Takeyoshi Kikuchi <kikuchi@centurysys.co.jp>
This commit is contained in:
Century Systems 2023-02-23 03:53:04 +09:00 • committed by GitHub
commit ab1d4a5d58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -750,3 +750,6 @@ var SEEK_SET* {.importc: "SEEK_SET", header: "<unistd.h>".}: cint
var SEEK_CUR* {.importc: "SEEK_CUR", header: "<unistd.h>".}: cint
var SEEK_END* {.importc: "SEEK_END", header: "<unistd.h>".}: cint
# <nuttx/config.h>
when defined(nuttx):
var NEPOLL_MAX* {.importc: "CONFIG_FS_NEPOLL_DESCRIPTORS", header: "<nuttx/config.h>".}: cint