1 (* Copyright (C
) 2009 Matthew Fluet
.
2 * Copyright (C
) 2004-2005 Henry Cejtin
, Matthew Fluet
, Suresh
3 * Jagannathan
, and Stephen Weeks
.
5 * MLton is released under a BSD
-style license
.
6 * See the file MLton
-LICENSE for details
.
12 val size
: 'a
-> int = fn _
=> ~
1
15 val history
= SMLofNJ
.exnHistory
19 fun collect () = SMLofNJ
.Internals
.GC
.doGC
8
20 fun setMessages b
= SMLofNJ
.Internals
.GC
.messages b
21 fun pack () = collect ()
30 val cmd
= dir ^
"/bin/" ^ cmd
31 val upDir
= OS
.FileSys
.realPath (dir ^
"/..")
33 if OS
.FileSys
.access (cmd
, [OS
.FileSys
.A_EXEC
])
39 val proc
= Unix
.execute (valOf (findCmd
"."), [])
40 val ins
= Unix
.textInstreamOf proc
41 val hostString
= TextIO.inputAll ins
42 val status
= Unix
.reap proc
45 (hostString
, 0, SOME (String.size hostString
- 1))
51 val toString
= fn s
=> s
52 val host
= mkHost
"host-arch"
57 val toString
= fn s
=> s
58 val host
= mkHost
"host-os"