getrlimit, setrlimit

Stephen Weeks MLton@sourcelight.com
Mon, 9 Jul 2001 15:56:39 -0700


Two things occur to me.

1. There is no need for resource to be a datatype, since we never need to match
   against it. 

2. We don't need to include all the resources for now.  So we could drop some
   if we want to.
 
Anyways, here is the new sig.  Suggestions for drops accepted.


signature MLTON_RLIMIT =
   sig
      type t = word

      type resource

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

      val get: resource -> {hard: t, soft: t}
      val infinity: t
      val set: resource * {hard: t, soft: t} -> unit
   end