Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/PervEnv/UnixNoPosix/os-process.sml
ViewVC logotype

View of /sml/trunk/src/compiler/PervEnv/UnixNoPosix/os-process.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 224 - (download) (annotate)
Sat Apr 17 16:27:01 1999 UTC (21 years, 2 months ago) by monnier
File size: 1043 byte(s)
This commit was generated by cvs2svn to compensate for changes in r223,
which included commits to RCS files with non-trunk default branches.
(* os-process.sml
 *
 * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
 *
 * The implementation of the generic process control interface (OS.Process).
 * The OS dependencies are hidden in the run-time system support.
 *
 *)

structure OS_Process : OS_PROCESS =
  struct

    structure CU = CleanUp

    type status = OS.Process.status (* int *)

    val success = 0
    val failure = 1

    val system : string -> status = CInterface.c_function "SMLNJ-OS" "system"

    local
      val hooks = ref ([] : (unit -> unit) list)
      val _ = CU.addCleaner (
	    "OS.Process",
	    [CU.AtExit],
	    fn _ => List.app (fn f => (f ()) handle _ => ()) (! hooks))
    in
    fun atExit hook = hooks := hook :: !hooks
    end

    val terminate : status -> 'a = CInterface.c_function "SMLNJ-OS" "exit"
    fun exit sts = (CU.clean CU.AtExit; terminate sts)

    val getEnv : string -> string option = CInterface.c_function "SMLNJ-OS" "getEnv"

  end

(*
 * $Log: os-process.sml,v $
 * Revision 1.1.1.1  1998/04/08 18:40:00  george
 * Version 110.5
 *
 *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0