1val _ = OS.FileSys.chDir "loopingdir";
2
3infix ++
4val op++ = OS.Path.concat
5
6val _ = print "Calling Holmake in loopingdir"
7
8fun die s = (TextIO.output(TextIO.stdErr, s ^ "\n");
9             OS.Process.exit OS.Process.failure)
10
11val _ =
12    if Systeml.isUnix then
13      let
14        val now = Time.now()
15        val res =
16            OS.Process.system ("/bin/sh -c 'ulimit -t 2 ; " ^
17                               Systeml.HOLDIR ++ "bin" ++ "Holmake'")
18      in
19        if OS.Process.isSuccess res then die "FAILED!?"
20        else let
21          val elapsed = Time.-(Time.now(), now)
22        in
23          if Time.>(elapsed, Time.fromMilliseconds 1500) then
24            die "FAILED!"
25          else print "OK\n"
26        end
27      end
28    else
29      let
30        val res = Systeml.systeml [Systeml.HOLDIR ++ "bin" ++ "Holmake'"]
31      in
32        if OS.Process.isSuccess res then die "FAILED!?"
33        else print "OK\n"
34      end
35