BSD syscall#194
svc · unix #194
getrlimit
Returns the soft and hard limits for a resource.
Prototype
int getrlimit(u_int which, struct rlimit *rlp);Returns: int
Arguments
| Name | Type | Dir | Description |
|---|---|---|---|
| which | u_int | - | |
| rlp | struct rlimit | - |
Version history
| XNU tag | macOS | # |
|---|---|---|
| xnu-1456.1.26 | macOS 10.6 Snow Leopard | 194 |
| xnu-1486.2.11 | — | 194 |
| xnu-1504.15.3 | — | 194 |
| xnu-1504.3.12 | — | 194 |
| xnu-1504.7.4 | — | 194 |
| xnu-1504.9.17 | — | 194 |
| xnu-1504.9.26 | — | 194 |
| xnu-1504.9.37 | — | 194 |
Notes
Resources include RLIMIT_NOFILE, RLIMIT_STACK, RLIMIT_AS, RLIMIT_CPU, RLIMIT_CORE, and others. The hard limit caps what setrlimit() can raise to; on macOS the kernel cap on RLIMIT_NOFILE is OPEN_MAX (10240) by default, even though launchd often configures higher.
Related APIs
setrlimitgetrusageproc_rlimit_controlgetdtablesizegetpriority