added string_of_pid;
authorwenzelm
Tue Oct 11 13:28:08 2005 +0200 (2005-10-11)
changeset 1782436b2978d339a
parent 17823 4735c07399c8
child 17825 ede984daba01
added string_of_pid;
src/Pure/ML-Systems/mosml.ML
src/Pure/ML-Systems/polyml.ML
src/Pure/ML-Systems/poplogml.ML
src/Pure/ML-Systems/smlnj.ML
     1.1 --- a/src/Pure/ML-Systems/mosml.ML	Tue Oct 11 13:28:07 2005 +0200
     1.2 +++ b/src/Pure/ML-Systems/mosml.ML	Tue Oct 11 13:28:08 2005 +0200
     1.3 @@ -156,6 +156,9 @@
     1.4    if Process.system cmd = Process.success then 0 else 1;
     1.5  
     1.6  
     1.7 +val string_of_pid = Int.toString;
     1.8 +
     1.9 +
    1.10  (* getenv *)
    1.11  
    1.12  fun getenv var =
     2.1 --- a/src/Pure/ML-Systems/polyml.ML	Tue Oct 11 13:28:07 2005 +0200
     2.2 +++ b/src/Pure/ML-Systems/polyml.ML	Tue Oct 11 13:28:08 2005 +0200
     2.3 @@ -178,6 +178,11 @@
     2.4    if OS.Process.isSuccess (OS.Process.system cmd) then 0 else 1;
     2.5  
     2.6  
     2.7 +(*Convert a process ID to a decimal string (chiefly for tracing)*)
     2.8 +fun string_of_pid pid = 
     2.9 +    Word.fmt StringCvt.DEC (Word.fromLargeWord (Posix.Process.pidToWord pid));
    2.10 +
    2.11 +
    2.12  (* getenv *)
    2.13  
    2.14  fun getenv var =
     3.1 --- a/src/Pure/ML-Systems/poplogml.ML	Tue Oct 11 13:28:07 2005 +0200
     3.2 +++ b/src/Pure/ML-Systems/poplogml.ML	Tue Oct 11 13:28:08 2005 +0200
     3.3 @@ -331,6 +331,8 @@
     3.4    let val (rc, result) = execute_result cmdline
     3.5    in TextIO.output (TextIO.stdOut, result); TextIO.flushOut TextIO.stdOut; rc end;
     3.6  
     3.7 +val string_of_pid: int -> string = makestring;
     3.8 +
     3.9  fun getenv var = (case OS.translate var of NONE => "" | SOME s => s);
    3.10  
    3.11  structure OS =
     4.1 --- a/src/Pure/ML-Systems/smlnj.ML	Tue Oct 11 13:28:07 2005 +0200
     4.2 +++ b/src/Pure/ML-Systems/smlnj.ML	Tue Oct 11 13:28:08 2005 +0200
     4.3 @@ -206,6 +206,11 @@
     4.4  val system = OS.Process.system: string -> int;
     4.5  
     4.6  
     4.7 +(*Convert a process ID to a decimal string (chiefly for tracing)*)
     4.8 +fun string_of_pid pid = 
     4.9 +    Word.fmt StringCvt.DEC (Word.fromLargeWord (Posix.Process.pidToWord pid));
    4.10 +
    4.11 +
    4.12  (* getenv *)
    4.13  
    4.14  fun getenv var =