<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.26">
<title>MLtonRlimit</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<link rel="stylesheet" href="./asciidoctor.css">
<link rel="stylesheet" href="./mlton.css">

</head>
<body class="article">
<div id="mlton-header">
<div id="mlton-header-text">
<h2>
<a href="./Home">
MLton
20241230+git20251029+dfsg-5
</a>
</h2>
</div>
</div>
<div id="header">
<h1>MLtonRlimit</h1>
</div>
<div id="content">
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sml">signature MLTON_RLIMIT =
   sig
      structure RLim : sig
                          type t
                          val castFromSysWord: SysWord.word -&gt; t
                          val castToSysWord: t -&gt; SysWord.word
                       end

      val infinity: RLim.t

      type t

      val coreFileSize: t        (* CORE    max core file size *)
      val cpuTime: t             (* CPU     CPU time in seconds *)
      val dataSize: t            (* DATA    max data size *)
      val fileSize: t            (* FSIZE   Maximum filesize *)
      val numFiles: t            (* NOFILE  max number of open files *)
      val lockedInMemorySize: t  (* MEMLOCK max locked address space *)
      val numProcesses: t        (* NPROC   max number of processes *)
      val residentSetSize: t     (* RSS     max resident set size *)
      val stackSize: t           (* STACK   max stack size *)
      val virtualMemorySize: t   (* AS      virtual memory limit *)

      val get: t -&gt; {hard: rlim, soft: rlim}
      val set: t * {hard: rlim, soft: rlim} -&gt; unit
   end</code></pre>
</div>
</div>
<div class="paragraph">
<p><code>MLton.Rlimit</code> provides a wrapper around the C <code>getrlimit</code> and
<code>setrlimit</code> functions.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>type Rlim.t</code></p>
<div class="paragraph">
<p>the type of resource limits.</p>
</div>
</li>
<li>
<p><code>infinity</code></p>
<div class="paragraph">
<p>indicates that a resource is unlimited.</p>
</div>
</li>
<li>
<p><code>type t</code></p>
<div class="paragraph">
<p>the types of resources that can be inspected and modified.</p>
</div>
</li>
<li>
<p><code>get r</code></p>
<div class="paragraph">
<p>returns the current hard and soft limits for resource <code>r</code>. May raise
<code>OS.SysErr</code>.</p>
</div>
</li>
<li>
<p><code>set (r, {hard, soft})</code></p>
<div class="paragraph">
<p>sets the hard and soft limits for resource <code>r</code>.  May raise
<code>OS.SysErr</code>.</p>
</div>
</li>
</ul>
</div>
</div>
</body>
</html>