1 (* Copyright (C
) 2004-2007 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
4 * MLton is released under a BSD
-style license
.
5 * See the file MLton
-LICENSE for details
.
8 (* Stub out functions that are not implemented on MinGW
. *)
10 structure Error
= PosixError
11 val stub
: string * ('a
-> 'b
) -> ('a
-> 'b
) =
13 if let open Primitive
.MLton
.Platform
.OS
in MinGW
= host
end
16 else (PrimitiveFFI
.Stdio
.print msg
17 ; PrimitiveFFI
.Stdio
.print
"\n")
18 ; Error
.raiseSysWithMsg (Error
.nosys
, msg
))
21 structure PrimitiveFFI
=
33 val poll
= stub ("poll", poll
)
45 val chown
= stub ("chown", chown
)
46 val fchown
= stub ("fchown", fchown
)
47 val fpathconf
= stub ("fpathconf", fpathconf
)
48 val link
= stub ("link", link
)
49 val mkfifo
= stub ("mkfifo", mkfifo
)
50 val pathconf
= stub ("pathconf", pathconf
)
51 val readlink
= stub ("readlink", readlink
)
52 val symlink
= stub ("symlink", symlink
)
59 val fcntl2
= stub ("fcntl2", fcntl2
)
60 val fcntl3
= stub ("fcntl3", fcntl3
)
67 val ctermid
= stub ("ctermid", ctermid
)
68 val getegid
= stub ("getegid", getegid
)
69 val geteuid
= stub ("geteuid", geteuid
)
70 val getgid
= stub ("getgid", getgid
)
71 val getgroups
= stub ("getgroups", getgroups
)
72 val getlogin
= stub ("getlogin", getlogin
)
73 val getpgrp
= stub ("getpgrp", getpgrp
)
74 val getppid
= stub ("getppid", getppid
)
75 val getuid
= stub ("getuid", getuid
)
76 val setgid
= stub ("setgid", setgid
)
77 val setgroups
= stub ("stegroups", setgroups
)
78 val setpgid
= stub ("setpgid", setpgid
)
79 val setsid
= stub ("setsid", setsid
)
80 val setuid
= stub ("setuid", setuid
)
81 val sysconf
= stub ("sysconf", sysconf
)
82 val times
= stub ("times", times
)
83 val ttyname
= stub ("ttyname", ttyname
)
90 val exece
= stub ("exece", exece
)
91 val execp
= stub ("execp", execp
)
92 val fork
= stub ("fork", fork
)
93 val pause
= stub ("pause", pause
)
94 val waitpid
= fn (args
as (pid
, _
, _
)) =>
96 then stub ("waitpid", waitpid
) args
104 val getgrgid
= stub ("getgrgid", getgrgid
)
105 val getgrnam
= stub ("getgrnam", getgrnam
)
106 val getpwuid
= stub ("getpwuid", getpwuid
)
117 val drain
= stub ("drain", drain
)
118 val flow
= stub ("flow", flow
)
119 val flush
= stub ("flush", flush
)
120 val getattr
= stub ("getattr", getattr
)
121 val getpgrp
= stub ("getpgrp", getpgrp
)
122 val sendbreak
= stub ("sendbreak", sendbreak
)
123 val setattr
= stub ("setattr", setattr
)
124 val setpgrp
= stub ("setpgrp", setpgrp
)
137 val toAddr
= stub ("toAddr", toAddr
)
138 val fromAddr
= stub ("fromAddr", fromAddr
)