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/cml/src/Win32/win32-process.sml
ViewVC logotype

View of /sml/trunk/src/cml/src/Win32/win32-process.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (download) (annotate)
Thu Jun 1 18:34:03 2000 UTC (19 years, 3 months ago) by monnier
File size: 843 byte(s)
bring revisions from the vendor branch to the trunk
(* win32-process.sml
 *
 * COPYRIGHT (c) 1998 Bell Labs, Lucent Technologies.
 *
 * Simulate some of the Posix.Process structure on Win32 machines
 *)

structure Win32Process : 
  sig

    type pid
    datatype exit_status = SUCCESS | FAIL
    val createProcess : string -> pid
    val waitForSingleObject : pid -> exit_status option

  end = struct

    type pid = Word32.word  (* actually, a handle *)
    datatype exit_status = SUCCESS | FAIL
	
    fun cfun x = Unsafe.CInterface.c_function "WIN32-PROCESS" x

    val createProcess : string -> pid = cfun "create_process"

    val wait_for_single_object : pid -> pid option = cfun "wait_for_single_object"
    fun waitForSingleObject (p : pid) = (case (wait_for_single_object p)
	   of NONE => NONE
	    | SOME (v) => if v=0w0 then SOME FAIL else SOME SUCCESS
	  (* end of case *))

  end 

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