Debian Codegraph @

doc/guide/src/MLtonRlimit.adoc

raw
1 = MLtonRlimit
2
3 [source,sml]
4 ----
5 signature MLTON_RLIMIT =
6 sig
7 structure RLim : sig
8 type t
9 val castFromSysWord: SysWord.word -> t
10 val castToSysWord: t -> SysWord.word
11 end
12
13 val infinity: RLim.t
14
15 type t
16
17 val coreFileSize: t (* CORE max core file size *)
18 val cpuTime: t (* CPU CPU time in seconds *)
19 val dataSize: t (* DATA max data size *)
20 val fileSize: t (* FSIZE Maximum filesize *)
21 val numFiles: t (* NOFILE max number of open files *)
22 val lockedInMemorySize: t (* MEMLOCK max locked address space *)
23 val numProcesses: t (* NPROC max number of processes *)
24 val residentSetSize: t (* RSS max resident set size *)
25 val stackSize: t (* STACK max stack size *)
26 val virtualMemorySize: t (* AS virtual memory limit *)
27
28 val get: t -> {hard: rlim, soft: rlim}
29 val set: t * {hard: rlim, soft: rlim} -> unit
30 end
31 ----
32
33 `MLton.Rlimit` provides a wrapper around the C `getrlimit` and
34 `setrlimit` functions.
35
36 * `type Rlim.t`
37 +
38 the type of resource limits.
39
40 * `infinity`
41 +
42 indicates that a resource is unlimited.
43
44 * `type t`
45 +
46 the types of resources that can be inspected and modified.
47
48 * `get r`
49 +
50 returns the current hard and soft limits for resource `r`. May raise
51 `OS.SysErr`.
52
53 * `set (r, {hard, soft})`
54 +
55 sets the hard and soft limits for resource `r`. May raise
56 `OS.SysErr`.