Skip to content

Add max file descriptors per process #2215

@dbwiddis

Description

@dbwiddis

See commentary here.

OSHI currently returns the systemwide limit in getMaxFileDescriptors(). On some OS's there is a per-process limit, for which we could add a getMaxFileDescriptorsPerProcess().

  • on Linux, /proc/sys/fs/nr-open or /proc/self/limits.
  • on macOS and FreeBSD, sysctl kern.maxfilesperproc
  • on Windows, try _getmaxstdio or hardcode 16 * 1024 * 1024 = 16,777,216.
  • on OpenBSD, try getdtablesize() or getrlimit() with RLIMIT_NOFILE.
  • on Solaris, try getrlimit() or these options
  • on AIX try /etc/security/limits, if it's not there assume unlimited

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR welcomeNot maintainer's priority to do but will accept contributions!hacktoberfestIssues we're happy for new #Hacktoberfest2020 participants to donew featureSomething OSHI doesn't do now but could doup for grabsIssues the maintainers want community help with

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions