Hi Alan, Greg.

Thanks for the advice.

Other POSIX-based systems use getrlimit(RLIMIT_NOFILE) to derive maxDescriptor.

----
## Returns the maximum number of active file descriptors for the current
      ## process. This involves a system call. For now `maxDescriptors` is
## supported on the following OSes: Windows, Linux, OSX, BSD, Solaris.
      when defined(windows):
        16_700_000
      elif defined(zephyr) or defined(freertos):
        FD_MAX
      elif defined(nuttx):
        # The maximum number of concurrently active UDP and TCP ports.
        NACTIVESOCKETS
      else: <--------- Linux, BSD here
        var fdLim: RLimit
        var res = int(getrlimit(RLIMIT_NOFILE, fdLim))
        if res >= 0:
          res = int(fdLim.rlim_cur) - 1
        res
----

In terms of "POSIX compliant", the same system calls could be used for a clean implementation, but NuttX currently returns a fixed value of 0.

----
  /* This is a dummy realization to make the compiler happy */

  memset(rlp, 0, sizeof(*rlp));
----

Is it possible to add an implementation within this systemcall?
(For starters, returning 128 as suggested by alan would be good.)


best regards,
KIKUCHI Takeyoshi

---------------------------------
kiku...@centurysys.co.jp

Reply via email to