Page MenuHomeFreeBSD

Introduce setrlimit_uid(2)
Needs ReviewPublic

Authored by bnovkov on Feb 1 2026, 5:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 2, 2:29 PM
Unknown Object (File)
Sat, Sep 26, 9:14 PM
Unknown Object (File)
Sat, Sep 19, 4:33 PM
Unknown Object (File)
Wed, Sep 16, 1:59 AM
Unknown Object (File)
Fri, Sep 11, 4:26 AM
Unknown Object (File)
Wed, Sep 9, 5:34 PM
Unknown Object (File)
Sep 5 2026, 9:41 AM
Unknown Object (File)
Sep 4 2026, 8:47 PM
Subscribers

Details

Reviewers
markj
olce
brooks
Summary

This change introduces setrlimit_uid(2), a new system call for changing
per-UID resource limits.

Unlike the setrlimit(2) system call, setrlimit_uid(2) operates on the
plimit structure stored in struct uidinfo.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70322
Build 67205: arc lint + arc unit

Event Timeline

This makes me wonder why not setrlimit_type(id_t id, int /*idtype_t*/ type, int which, const struct rlimit *rlp), but it's not clear most types really want limits so it feels overall like premature generalization.

sys/kern/syscalls.master
3428
sys/sys/resource.h
200

I feel like I'd put the uid_t at the front of the list so it's "subject", "action", but don't have a strong justification.

Rebase and address @brooks 's comment.