Skip to content

Add more RLIMIT_* constants #137512

Closed
Closed

Description

@serhiy-storchaka

Feature or enhancement

There are some RLIMIT_* constants on Posix platforms which are not currently exposed in the resource module.

  • RLIMIT_NTHR. Available on NetBSD >= 7.0, QNX >= 6.3.2.
  • RLIMIT_UMTXP. Available on FreeBSD >= 11.
  • RLIMIT_PIPEBUF. Available in the main branch on FreeBSD (>= 15?) >= 14.2.
  • RLIMIT_THREADS. Available on AIX. The same as RLIMIT_NTHR?
  • RLIMIT_VMEM. Available on Solaris/OpenIndiana. On FreeBSD >= 5.3 it is an alias of RLIMIT_AS.

Constants RLIM_SAVED_CUR and RLIM_SAVED_MAX are used on some platforms (Solaris/OpenIndiana, AIX) to represent values that cannot be represented in 32-bit rlim_t.

It is perhaps too early to add RLIMIT_PIPEBUF.

RLIMIT_NTHR and RLIMIT_THREADS, should we only add one of them on the corresponding platform or add both names as aliases of one other?

RLIMIT_VMEM. Should we add it as an alias of RLIMIT_AS on all other platforms?

I am not sure whether RLIM_SAVED_CUR and RLIM_SAVED_MAX are still relevant on modern Unixes. Their use is complicated. They are the part of Posix, but not defined on Linux. On FreeBSD they are aliases of RLIM_INFINITY and are not useful at all.

Linked PRs

Activity

  1. serhiy-storchaka commented on Aug 7, 2025

    @serhiy-storchaka
    MemberAuthor

    On other look, RLIMIT_NTHR and RLIMIT_THREADS are different. The former is per user and the latter is per process.

  2. serhiy-storchaka commented on Aug 7, 2025

    @serhiy-storchaka
    MemberAuthor

    Ah, RLIMIT_VMEM was already added.

  3. added 2 commits that reference this issue on Aug 7, 2025
  4. added a commit that references this issue on Aug 7, 2025
  5. removed
    3.15bugs and security fixes
    on Aug 8, 2025
  6. added a commit that references this issue on Aug 19, 2025
  7. serhiy-storchaka commented on Aug 19, 2025

    @serhiy-storchaka
    MemberAuthor

    As was pointed by @encukou, RLIM_SAVED_CUR and RLIM_SAVED_MAX are defined on Linux too as aliases of RLIM_INFINITY. They are a part of Posix, so should be defined everywhere (but may be useless).

  8. encukou commented on Aug 19, 2025

    @encukou
    Member

    I did edit the message. The PR does add docs (and tests) for RLIMIT_PIPEBUF, and make other docs fixes.

  9. added a commit that references this issue on Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions