Skip to content
BSD syscall#446

svc · unix #446

proc_rlimit_control

Apple-private control for per-process resource limits, notably CPU usage monitors.

Prototype

int proc_rlimit_control(pid_t pid, int flavor, void *arg);

Returns: int

Arguments

NameTypeDirDescription
pidpid_t-
flavorint-
argvoid-

Version history

XNU tagmacOS#
xnu-2422.115.4macOS 10.9 Mavericks446
xnu-2782.40.9macOS 10.10 Yosemite446
xnu-3247.1.106macOS 10.11 El Capitan446
xnu-3789.1.32macOS 10.12 Sierra446
xnu-4570.1.46macOS 10.13 High Sierra446
xnu-4903.221.2macOS 10.14 Mojave446
xnu-6153.11.26macOS 10.15 Catalina446
xnu-7195.50.7.100.1macOS 11.0 Big Sur446
xnu-8019.41.5macOS 12.0 Monterey446
xnu-8792.41.9macOS 13.0 Ventura446
xnu-10002.1.13macOS 14.0 Sonoma446
xnu-11215.1.10macOS 15.0 Sequoia446
xnu-11417.101.15macOS 15.4 Sequoia446
xnu-12377.1.9macOS 26.0 Tahoe446
xnu-10002.41.9—446
xnu-10002.61.3—446
xnu-10002.81.5—446
xnu-10063.101.15—446
xnu-10063.121.3—446
xnu-10063.141.1—446
xnu-11215.41.3—446
xnu-11215.61.5—446
xnu-11215.81.4—446
xnu-11417.121.6—446
xnu-11417.140.69—446
xnu-12377.101.15—446
xnu-12377.41.6—446
xnu-12377.61.12—446
xnu-12377.81.4—446
xnu-2422.1.72—446
xnu-2422.100.13—446
xnu-2422.110.17—446
xnu-2422.90.20—446
xnu-2782.1.97—446
xnu-2782.10.72—446
xnu-2782.20.48—446
xnu-2782.30.5—446
xnu-3247.10.11—446
xnu-3248.20.55—446
xnu-3248.30.4—446
xnu-3248.40.184—446
xnu-3248.50.21—446
xnu-3248.60.10—446
xnu-3789.21.4—446
xnu-3789.31.2—446
xnu-3789.41.3—446
xnu-3789.51.2—446
xnu-3789.60.24—446
xnu-3789.70.16—446
xnu-4570.20.62—446
xnu-4570.31.3—446
xnu-4570.41.2—446
xnu-4570.51.1—446
xnu-4570.61.1—446
xnu-4570.71.2—446
xnu-4903.231.4—446
xnu-4903.241.1—446
xnu-4903.270.47—446
xnu-6153.101.6—446
xnu-6153.121.1—446
xnu-6153.141.1—446
xnu-6153.41.3—446
xnu-6153.61.1—446
xnu-6153.81.5—446
xnu-7195.101.1—446
xnu-7195.121.3—446
xnu-7195.141.2—446
xnu-7195.60.75—446
xnu-7195.81.3—446
xnu-8019.61.5—446
xnu-8019.80.24—446
xnu-8020.101.4—446
xnu-8020.121.3—446
xnu-8020.140.41—446
xnu-8792.61.2—446
xnu-8792.81.2—446
xnu-8796.101.5—446
xnu-8796.121.2—446
xnu-8796.141.3—446

Notes

Extends the BSD rlimit story with Darwin-specific knobs: RLIMIT_WAKEUPS_MONITOR caps wakeups per second (used to detect 'wake spammer' apps), and RLIMIT_CPU_USAGE_MONITOR pairs a cpu percentage with an interval. The kernel can elevate this from soft warning to SIGKILL via the resource-violation jetsam path. Used heavily by ReportCrash, sysdiagnose, and powerd telemetry.

Detection

DTrace syscall::proc_rlimit_control:entry surfaces the flavor in arg1. Powerlog and the 'CPU usage' tab of Activity Monitor visualize the underlying counters.

Related APIs

getrlimitsetrlimitgetrusagegetprioritysetpriority