[MLton-commit] r4330

Matthew Fluet MLton@mlton.org
Sun, 29 Jan 2006 16:44:13 -0800


Mostly complete reintegration of generated basis library FFI.  Almost
all regressions pass; something busted with sockets and with IntInf.

MLton MLTONVERSION (built Sun Jan 29 19:07:18 2006 on localhost.localdomain)
flags = -type-check true 
testing 10
testing 11
testing 12
testing 13
testing 14
testing 15
testing 16
testing 17
testing 18
testing 19
testing 1
testing 20
testing 21
testing 22
testing 23
testing 2
testing 3
testing 4
testing 5
testing 6
testing 7
testing 8
testing 9
testing abcde
testing abstype
testing all-overloads
testing array2
testing array3
testing array4
testing array5
testing array6
testing array7
testing array
testing asterisk
testing basis-sharing
testing big-array
testing binio
testing bool-triple
testing bytechar
testing callcc2
testing callcc3
testing callcc
testing cases
testing char0
testing char.scan
testing check_arrays
testing circular
testing cmdline
testing cobol
testing command-line
testing comment-end
testing constraint
testing conv2
0a1,6
> FailRead, base = BIN, str = |1000000000000000000000000000000|
> FailRead, base = BIN, str = |1000000000000000000000000000001|
> FailRead, base = BIN, str = |~1000000000000000000000000000001|
> FailRead, base = BIN, str = |1000000000000000000000000000010|
> FailRead, base = BIN, str = |~1000000000000000000000000000010|
> FailRead, base = BIN, str = |~10000000000000000000000000000000|
difference with -type-check true 
testing conv
1c1,44495308
< All ok
---
> Fail 3: ~1
difference with -type-check true 
testing cycle
testing datatype-with-free-tyvars
testing date
testing dead
testing deep-flatten
testing default-overloads
testing down
testing echo
1c1,3
< server processed 1900 bytes
---
> unhandled exception: SysErr: Invalid argument [inval]
> ./bin/regression: line 112: 30636 Terminated              ./$f
> Nonzero exit status.
difference with -type-check true 
testing eq
testing eqtype
testing exhaustive
testing exn2
testing exnHistory3
testing exnHistory
testing exn
testing expansive-valbind
testing exponential
testing ex
testing fact
testing fast2
testing fast
testing ffi-opaque
testing ffi
testing fft
testing filesys
testing finalize.2
testing finalize.3
testing finalize.4
testing finalize.5
testing finalize
testing fixed-integer
13a14,17
> Int31: abs ~1073741824 = Overflow <> ~1073741824
> Int31: ~ ~1073741824 = Overflow <> ~1073741824
> Int31: ~1073741824 div ~1 = Overflow <> ~1073741824
> Int31: ~1073741824 quot ~1 = Overflow <> ~1073741824
difference with -type-check true 
testing flat-array.2
testing flat-array.3
testing flat-array
testing flat-vector
testing flexrecord
testing format
testing ftruncate
testing FuhMishra
testing functor
testing gc-collect
testing general
testing grow-raise
testing harmonic
testing hello-world
testing id
testing int-inf.0
testing int-inf.1
testing int-inf.2
difference with -type-check true 
testing int-inf.3
1c1
< true12345
---
> true~9129
difference with -type-check true 
testing int-inf.4
testing int-inf.5
testing int-inf.bitops
testing int-inf.compare
difference with -type-check true 
testing int-inf.log2
6,12c6,7
< 30
< 31
< 32
< 32
< 33
< 33
< OK
---
> unhandled exception: Domain
> Nonzero exit status.
difference with -type-check true 
testing int-overflow
testing int
testing jump
testing kitdangle3
testing kitdangle
testing kitfib35
testing kitkbjul9
testing kitlife35u
testing kitloop2
testing kitmandelbrot
testing kitqsort
testing kitreynolds2
testing kitreynolds3
testing kitsimple
testing kittmergesort
testing kkb36c
testing kkb_eq
testing klife_eq
testing known-case0
testing known-case1
testing lambda-list-ref
testing layout
testing lex
testing lib
testing life
testing listpair
testing list
testing llv
testing local-ref
testing math
testing mlton.overload
testing mlton.share
testing mlton.word
testing modules
testing msort
testing mutex
testing nested-loop
testing nonexhaustive
testing once
testing only-one-exception
testing opaque2
testing opaque
testing open
testing os-exit
testing overloading
testing pack-real
testing pack
testing pack-word
testing parse
testing pat
testing poly-equal.2
testing poly-equal
testing polymorphic-recursion
testing posix-exit
testing posix-procenv
testing print-self
testing prodcons
testing pseudokit
testing real
testing ref-flatten.2
testing ref-flatten.3
testing ref-flatten.4
testing ref-flatten.5
testing ref-flatten.6
testing ref-flatten
testing ring
testing rlimit
Error: rlimit.sml 5.48.
  Undefined variable lockedInMemorySize.
Error: rlimit.sml 6.5.
  Undefined variable numProcesses.
Error: rlimit.sml 6.19.
  Undefined variable residentSetSize.
compilation aborted: parseAndElaborate reported errors
compilation of rlimit failed with -type-check true 
testing same-fringe
testing scon
testing semicolon
testing sharing
testing signals2
testing signals
testing sigs
testing size
testing slow2
testing slower
testing slow
testing smith-normal-form
testing socket
testing string2
testing stringcvt
testing string.fromString
testing string
testing substring-overflow
testing substring
testing suspend
testing tak
testing taut
testing testdyn1
testing testMatrix
testing textio.2
testing textio
testing thread0
testing thread1
testing thread2
testing thread-switch
testing time2
testing time3
testing time4
testing timeout
testing time
testing tststrcmp
testing type-check
testing typespec
testing unary.2
testing unary
testing undetermined
testing unixpath
testing useless-string
testing valrec
testing vector2
testing vector3
testing vector4
testing vector-loop
testing vector
testing weak
testing where-and
testing where
testing withtype
testing word8array
testing word8vector
testing word-all
testing wordn-array
testing word
testing world1
testing world2
testing world3
testing world4
testing world5
testing world6
testing barnes-hut
testing boyer
testing checksum
testing count-graphs
testing DLXSimulator
testing fft
testing fib
testing flat-array
skipping fxp
skipping hamlet
testing imp-for
testing knuth-bendix
testing lexgen
testing life
testing logic
testing mandelbrot
testing matrix-multiply
testing md5
testing merge
testing mlyacc
testing model-elimination
testing mpuz
testing nucleic
testing output1
testing peek
testing psdes-random
testing ratio-regions
testing ray
testing raytrace
testing simple
testing smith-normal-form
testing tailfib
testing tak
testing tensor
testing tsp
testing tyan
testing vector-concat
testing vector-rev
testing vliw
testing wc-input1
testing wc-scanStream
testing zebra
testing zern
testing mllex
testing mlyacc
testing mlprof


----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-extra/basis-extra.mlb
U   mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/net/generic-sock.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/net/inet-sock.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sig
U   mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/net/unix-sock.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/posix/io.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/posix/stub-mingw.sml
A   mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb
U   mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.sml
U   mlton/branches/on-20050822-x86_64-branch/mlton/backend/pointer-tycon.fun
U   mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun
U   mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-extra/basis-extra.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-extra/basis-extra.mlb	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/libs/basis-extra/basis-extra.mlb	2006-01-30 00:44:07 UTC (rev 4330)
@@ -9,7 +9,7 @@
    "deadCode true"
    "sequenceNonUnit warn"
    "nonexhaustiveMatch warn" "redundantMatch warn"
-   "warnUnused true" "forceUsed"
+   "warnUnused false" "forceUsed"
 in
    local
       ../../primitive/primitive.mlb

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/process.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -7,7 +7,7 @@
 
 structure MLtonProcess =
    struct
-      structure Prim = Primitive.MLton.Process
+      structure Prim = PrimitiveFFI.MLton.Process
       structure MLton = Primitive.MLton
       local
          open Posix
@@ -219,7 +219,7 @@
                        then
                           SysCall.simple
                           (fn () =>
-                           Primitive.Windows.Process.terminate (pid, signal))
+                           PrimitiveFFI.Windows.Process.terminate (pid, signal))
                     else Process.kill (Process.K_PROC pid, signal)
               in
                  ignore (reap p)
@@ -267,7 +267,7 @@
                     | _ => raise Fail "create"
                 end
              val p =
-                Primitive.Windows.Process.create
+                PrimitiveFFI.Windows.Process.create
                 (NullString.nullTerm cmd, args, env, stdin, stdout, stderr)
              val p' = Pid.toInt p
           in

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/net/generic-sock.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/net/generic-sock.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/net/generic-sock.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -7,7 +7,7 @@
 
 structure GenericSock : GENERIC_SOCK =
    struct
-      structure Prim = Primitive.Socket.GenericSock
+      structure Prim = PrimitiveFFI.Socket.GenericSock
       structure PE = Posix.Error
       structure PESC = PE.SysCall
 
@@ -22,13 +22,13 @@
 
       fun socketPair' (af, st, p) =
          let
-            val s1 = ref 0
-            val s2 = ref 0
+            val a = Array.array (2, 0)
          in
             PESC.syscall
             (fn () =>
-             let val n = Prim.socketPair (NetHostDB.addrFamilyToInt af, st, p, s1, s2)
-             in (n, fn () => (intToSock (!s1), intToSock (!s2)))
+             let val n = Prim.socketPair (NetHostDB.addrFamilyToInt af, st, p, a)
+             in (n, fn () => (intToSock (Array.sub (a, 0)), 
+                              intToSock (Array.sub (a, 1))))
              end)
          end
       

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/net/inet-sock.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/net/inet-sock.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/net/inet-sock.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -7,7 +7,7 @@
 
 structure INetSock:> INET_SOCK =
    struct
-      structure Prim = Primitive.Socket.INetSock
+      structure Prim = PrimitiveFFI.Socket.INetSock
          
       datatype inet = INET (* a phantom type*)
       type 'sock_type sock = (inet, 'sock_type) Socket.sock
@@ -15,7 +15,7 @@
       type dgram_sock = Socket.dgram sock
       type sock_addr = inet Socket.sock_addr
 
-      val inetAF = NetHostDB.intToAddrFamily Primitive.Socket.AF.INET
+      val inetAF = NetHostDB.intToAddrFamily PrimitiveFFI.Socket.AF.INET
 
       fun toAddr (in_addr, port) =
          if port < 0 orelse port >= 0x10000
@@ -51,7 +51,7 @@
       
       structure TCP =
          struct
-            structure Prim = Prim.TCP
+            structure Prim = Prim.Ctl
 
             fun socket' prot =
                GenericSock.socket' (inetAF, Socket.SOCK.stream, prot)
@@ -60,10 +60,10 @@
 
             fun getNODELAY sock =
               Socket.CtlExtra.getSockOptBool
-              (Prim.TCP, Prim.NODELAY) sock
+              (Prim.IPPROTO_TCP, Prim.TCP_NODELAY) sock
 
             fun setNODELAY (sock,optval) =
               Socket.CtlExtra.setSockOptBool
-              (Prim.TCP, Prim.NODELAY) (sock,optval)
+              (Prim.IPPROTO_TCP, Prim.TCP_NODELAY) (sock,optval)
          end
    end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sig	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sig	2006-01-30 00:44:07 UTC (rev 4330)
@@ -171,7 +171,7 @@
     val fdToSock: Posix.FileSys.file_desc -> ('af, 'sock_type) sock
     type pre_sock_addr
     val unpackSockAddr: 'af sock_addr -> Word8Vector.vector
-    val new_sock_addr: unit -> (pre_sock_addr * int ref * (unit -> 'af sock_addr))
+    val new_sock_addr: unit -> (pre_sock_addr * C.Socklen.t ref * (unit -> 'af sock_addr))
 
     structure CtlExtra:
        sig

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/net/socket.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -6,33 +6,35 @@
  *)
 
 structure Socket:> SOCKET_EXTRA
-   where type SOCK.sock_type = Primitive.Socket.SOCK.sock_type
+   where type SOCK.sock_type = C.Int.t
    where type pre_sock_addr = Word8.word array
 =
 struct
 
-structure Prim = Primitive.Socket
+structure Prim = PrimitiveFFI.Socket
 structure Error = Posix.Error
 structure Syscall = Error.SysCall
 structure FileSys = Posix.FileSys
 
-type sock = Prim.sock
-val sockToWord = SysWord.fromInt o Prim.toInt
-val wordToSock = Prim.fromInt o SysWord.toInt
+type sock = C.Sock.t
+val sockToWord = SysWord.fromInt o C.Sock.toInt
+val wordToSock = C.Sock.fromInt o SysWord.toInt
 fun sockToFD sock = FileSys.wordToFD (sockToWord sock)
 fun fdToSock fd = wordToSock (FileSys.fdToWord fd)
 
-type pre_sock_addr = Prim.pre_sock_addr
-datatype sock_addr = SA of Prim.sock_addr
+type pre_sock_addr = Word8.word array
+datatype sock_addr = SA of Word8.word vector
 fun unpackSockAddr (SA sa) = Word8Vector.fromPoly sa
-fun new_sock_addr (): (pre_sock_addr * int ref * (unit -> sock_addr)) = 
+fun new_sock_addr (): (pre_sock_addr * C.Socklen.t ref * (unit -> sock_addr)) = 
    let
-      val sa = Array.array (Prim.sockAddrLenMax, 0wx0)
-      val salen = ref (Array.length sa)
+      val salen = C.Size.toInt Prim.sockAddrStorageLen
+      val sa = Array.array (salen, 0wx0)
+      val salenRef = ref (C.Socklen.fromInt salen)
       fun finish () =
-         SA (ArraySlice.vector (ArraySlice.slice (sa, 0, SOME (!salen))))
+         SA (ArraySlice.vector (ArraySlice.slice 
+                                (sa, 0, SOME (C.Socklen.toInt (!salenRef)))))
    in
-      (sa, salen, finish)
+      (sa, salenRef, finish)
    end
 datatype dgram = DGRAM (* phantom *)
 datatype stream = MODE (* phantom *)
@@ -62,7 +64,7 @@
 
 structure SOCK =
    struct
-      type sock_type = Prim.SOCK.sock_type
+      type sock_type = C.Int.t
       val stream = Prim.SOCK.STREAM
       val dgram = Prim.SOCK.DGRAM
       val names = [
@@ -82,9 +84,9 @@
 
 structure CtlExtra =
    struct
-      type level = Prim.Ctl.level
-      type optname = Prim.Ctl.optname
-      type request = Prim.Ctl.request
+      type level = C.Int.t
+      type optname = C.Int.t
+      type request = C.Int.t
       
       (* host byte order *)
       structure PW = PackWord32Host
@@ -140,14 +142,14 @@
                fun getSockOpt (level: level, optname: optname) s =
                   let
                      val optval = Word8Array.array (optlen, 0wx0)
-                     val optlen = ref optlen
+                     val optlen = ref (C.Socklen.fromInt optlen)
                   in
                      Syscall.simple
                      (fn () =>
                       Prim.Ctl.getSockOpt (s, level, optname,
                                            Word8Array.toPoly optval,
                                            optlen))
-                     ; unmarshal (optval, !optlen, 0)
+                     ; unmarshal (optval, C.Socklen.toInt (!optlen), 0)
                   end
                fun setSockOpt (level: level, optname: optname) (s, optval) =
                   let
@@ -158,7 +160,7 @@
                      (fn () => 
                       Prim.Ctl.setSockOpt (s, level, optname,
                                            Word8Vector.toPoly optval,
-                                           optlen))
+                                           C.Socklen.fromInt optlen))
                   end
                fun getIOCtl (request: request) s : 'a =
                   let
@@ -191,36 +193,35 @@
             make (timeOptLen, marshalTimeOpt, unmarshalTimeOpt)
       end
 
-      val getDEBUG = getSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.DEBUG)
-      val setDEBUG = setSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.DEBUG)
-      val getREUSEADDR = getSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.REUSEADDR)
-      val setREUSEADDR = setSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.REUSEADDR)
-      val getKEEPALIVE = getSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.KEEPALIVE)
-      val setKEEPALIVE = setSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.KEEPALIVE)
-      val getDONTROUTE = getSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.DONTROUTE)
-      val setDONTROUTE = setSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.DONTROUTE)
-      val getBROADCAST = getSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.BROADCAST)
-      val getLINGER = getSockOptTimeOpt (Prim.Ctl.SOCKET, Prim.Ctl.LINGER)
-      val setLINGER = setSockOptTimeOpt (Prim.Ctl.SOCKET, Prim.Ctl.LINGER)
-      val setBROADCAST = setSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.BROADCAST)
-      val getOOBINLINE = getSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.OOBINLINE)
-      val setOOBINLINE = setSockOptBool (Prim.Ctl.SOCKET, Prim.Ctl.OOBINLINE)
-      val getSNDBUF = getSockOptInt (Prim.Ctl.SOCKET, Prim.Ctl.SNDBUF)
-      val setSNDBUF = setSockOptInt (Prim.Ctl.SOCKET, Prim.Ctl.SNDBUF)
-      val getRCVBUF = getSockOptInt (Prim.Ctl.SOCKET, Prim.Ctl.RCVBUF)
-      val setRCVBUF = setSockOptInt (Prim.Ctl.SOCKET, Prim.Ctl.RCVBUF)
-      fun getTYPE s =
-         Prim.SOCK.fromInt (getSockOptInt (Prim.Ctl.SOCKET, Prim.Ctl.TYPE) s)
+      val getDEBUG = getSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_DEBUG)
+      val setDEBUG = setSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_DEBUG)
+      val getREUSEADDR = getSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_REUSEADDR)
+      val setREUSEADDR = setSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_REUSEADDR)
+      val getKEEPALIVE = getSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_KEEPALIVE)
+      val setKEEPALIVE = setSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_KEEPALIVE)
+      val getDONTROUTE = getSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_DONTROUTE)
+      val setDONTROUTE = setSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_DONTROUTE)
+      val getBROADCAST = getSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_BROADCAST)
+      val getLINGER = getSockOptTimeOpt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_LINGER)
+      val setLINGER = setSockOptTimeOpt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_LINGER)
+      val setBROADCAST = setSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_BROADCAST)
+      val getOOBINLINE = getSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_OOBINLINE)
+      val setOOBINLINE = setSockOptBool (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_OOBINLINE)
+      val getSNDBUF = getSockOptInt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_SNDBUF)
+      val setSNDBUF = setSockOptInt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_SNDBUF)
+      val getRCVBUF = getSockOptInt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_RCVBUF)
+      val setRCVBUF = setSockOptInt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_RCVBUF)
+      fun getTYPE s = getSockOptInt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_TYPE) s
       fun getERROR s =
          let
-            val se = getSockOptInt (Prim.Ctl.SOCKET, Prim.Ctl.ERROR) s
+            val se = getSockOptInt (Prim.Ctl.SOL_SOCKET, Prim.Ctl.SO_ERROR) s
          in
             if 0 = se
                then NONE
             else SOME (Posix.Error.errorMsg se, SOME se)
          end handle Error.SysErr z => SOME z
       local
-         fun getName (s, f: Prim.sock * pre_sock_addr * int ref -> int) =
+         fun getName (s, f: sock * pre_sock_addr * C.Socklen.t ref -> int) =
             let
                val (sa, salen, finish) = new_sock_addr ()
                val () = Syscall.simple (fn () => f (s, sa, salen))
@@ -231,8 +232,8 @@
          fun getPeerName s = getName (s, Prim.Ctl.getPeerName)
          fun getSockName s = getName (s, Prim.Ctl.getSockName)
       end
-      val getNREAD = getIOCtlInt Prim.Ctl.NREAD
-      val getATMARK = getIOCtlBool Prim.Ctl.ATMARK
+      val getNREAD = getIOCtlInt Prim.Ctl.FIONREAD
+      val getATMARK = getIOCtlBool Prim.Ctl.SIOCATMARK
    end
 
 structure Ctl =
@@ -247,7 +248,7 @@
 fun familyOfAddr (SA sa) = NetHostDB.intToAddrFamily (Prim.familyOfAddr sa)
 
 fun bind (s, SA sa) =
-   Syscall.simple (fn () => Prim.bind (s, sa, Vector.length sa))
+   Syscall.simple (fn () => Prim.bind (s, sa, C.Socklen.fromInt (Vector.length sa)))
 
 fun listen (s, n) = 
    Syscall.simple (fn () => Prim.listen (s, n))
@@ -271,7 +272,7 @@
 in
    fun withNonBlock (s, f: unit -> 'a) =
       let
-         val fd = Primitive.FileDesc.fromInt (Prim.toInt s)
+         val fd = s
          val flags = 
             Syscall.simpleResultRestart (fn () => PIO.fcntl2 (fd, PIO.F_GETFL))
          val _ =
@@ -289,12 +290,12 @@
 end
 
 fun connect (s, SA sa) =
-   Syscall.simple (fn () => Prim.connect (s, sa, Vector.length sa))
+   Syscall.simple (fn () => Prim.connect (s, sa, C.Socklen.fromInt (Vector.length sa)))
 
 fun connectNB (s, SA sa) =
    nonBlock'
    ({restart = false}, fn () => 
-    withNonBlock (s, fn () => Prim.connect (s, sa, Vector.length sa)),
+    withNonBlock (s, fn () => Prim.connect (s, sa, C.Socklen.fromInt (Vector.length sa))),
     fn _ => true,
     Error.inprogress, false)
 
@@ -303,7 +304,7 @@
       val (sa, salen, finish) = new_sock_addr ()
       val s = Syscall.simpleResultRestart (fn () => Prim.accept (s, sa, salen))
    in
-      (Prim.fromInt s, finish ())
+      (s, finish ())
    end
 
 fun acceptNB s =
@@ -312,7 +313,7 @@
    in
       nonBlock
       (fn () => withNonBlock (s, fn () => Prim.accept (s, sa, salen)),
-       fn s => SOME (Prim.fromInt s, finish ()),
+       fn s => SOME (s, finish ()),
        NONE)
    end
 
@@ -380,8 +381,8 @@
 type out_flags = {don't_route: bool, oob: bool}
 
 fun mk_out_flags {don't_route, oob} =
-   Word.orb (if don't_route then Prim.MSG_DONTROUTE else 0wx0,
-                Word.orb (if oob then Prim.MSG_OOB else 0wx0,
+   Word.orb (if don't_route then Word.fromInt Prim.MSG_DONTROUTE else 0wx0,
+                Word.orb (if oob then Word.fromInt Prim.MSG_OOB else 0wx0,
                              0wx0))
 val no_out_flags = {don't_route = false, oob = false}
 
@@ -396,7 +397,8 @@
                val (buf, i, sz) = base sl
             in
                Syscall.simpleResultRestart
-               (fn () => primSend (s, buf, i, sz, mk_out_flags out_flags))
+               (fn () => primSend (s, buf, i, C.Size.fromInt sz, 
+                                   Word.toInt (mk_out_flags out_flags)))
             end
          fun send (sock, buf) = send' (sock, buf, no_out_flags)
          fun sendNB' (s, sl, out_flags) =
@@ -405,8 +407,10 @@
             in
                nonBlock
                (fn () =>
-                primSend (s, buf, i, sz,
-                          Word.orb (Prim.MSG_DONTWAIT, mk_out_flags out_flags)),
+                primSend (s, buf, i, C.Size.fromInt sz,
+                          Word.toInt (
+                          Word.orb (Word.fromInt Prim.MSG_DONTWAIT, 
+                                    mk_out_flags out_flags))),
                 SOME, 
                 NONE)
             end
@@ -417,8 +421,9 @@
             in
                Syscall.simpleRestart
                (fn () =>
-                primSendTo (s, buf, i, sz,
-                            mk_out_flags out_flags, sa, Vector.length sa))
+                primSendTo (s, buf, i, C.Size.fromInt sz,
+                            Word.toInt (mk_out_flags out_flags), 
+                            sa, C.Socklen.fromInt (Vector.length sa)))
             end
          fun sendTo (sock, sock_addr, sl) =
             sendTo' (sock, sock_addr, sl, no_out_flags)
@@ -428,10 +433,11 @@
             in
                nonBlock 
                (fn () =>
-                primSendTo (s, buf, i, sz,
-                            Word.orb (Prim.MSG_DONTWAIT,
-                                      mk_out_flags out_flags),
-                            sa, Vector.length sa),
+                primSendTo (s, buf, i, C.Size.fromInt sz,
+                            Word.toInt (
+                            Word.orb (Word.fromInt Prim.MSG_DONTWAIT,
+                                      mk_out_flags out_flags)),
+                            sa, C.Socklen.fromInt (Vector.length sa)),
                 fn _ => true,
                 false)
             end
@@ -444,11 +450,11 @@
    val (sendArr, sendArr', sendArrNB, sendArrNB',
         sendArrTo, sendArrTo', sendArrToNB, sendArrToNB') =
       make (Word8ArraySlice.base, Word8Array.toPoly,
-            Prim.sendArr, Prim.sendToArr)
+            Prim.sendArr, Prim.sendArrTo)
    val (sendVec, sendVec', sendVecNB, sendVecNB',
         sendVecTo, sendVecTo', sendVecToNB, sendVecToNB') =
       make (Word8VectorSlice.base, Word8Vector.toPoly,
-            Prim.sendVec, Prim.sendToVec)
+            Prim.sendVec, Prim.sendVecTo)
 end
 
 type in_flags = {peek: bool, oob: bool}
@@ -456,8 +462,8 @@
 val no_in_flags = {peek = false, oob = false}
             
 fun mk_in_flags {peek, oob} =
-   Word.orb (if peek then Prim.MSG_PEEK else 0wx0,
-                Word.orb (if oob then Prim.MSG_OOB else 0wx0,
+   Word.orb (if peek then Word.fromInt Prim.MSG_PEEK else 0wx0,
+                Word.orb (if oob then Word.fromInt Prim.MSG_OOB else 0wx0,
                              0wx0))
 
 fun recvArr' (s, sl, in_flags) =
@@ -465,7 +471,8 @@
       val (buf, i, sz) = Word8ArraySlice.base sl
    in
       Syscall.simpleResultRestart
-      (fn () => Prim.recv (s, Word8Array.toPoly buf, i, sz, mk_in_flags in_flags))
+      (fn () => Prim.recv (s, Word8Array.toPoly buf, i, C.Size.fromInt sz, 
+                           Word.toInt (mk_in_flags in_flags)))
    end
 
 fun getVec (a, n, bytesRead) =
@@ -492,8 +499,9 @@
       val (sa, salen, finish) = new_sock_addr ()
       val n =
          Syscall.simpleResultRestart
-         (fn () => Prim.recvFrom (s, Word8Array.toPoly buf, i, sz,
-                                  mk_in_flags in_flags, sa, salen))
+         (fn () => Prim.recvFrom (s, Word8Array.toPoly buf, i, C.Size.fromInt sz,
+                                  Word.toInt (mk_in_flags in_flags), 
+                                  sa, salen))
    in
       (n, finish ())
    end
@@ -511,15 +519,15 @@
 
 fun recvVecFrom (sock, n) = recvVecFrom' (sock, n, no_in_flags)
 
-fun mk_in_flagsNB z = Word.orb (mk_in_flags z, Prim.MSG_DONTWAIT)
+fun mk_in_flagsNB z = Word.orb (mk_in_flags z, Word.fromInt Prim.MSG_DONTWAIT)
 
 fun recvArrNB' (s, sl, in_flags) =
    let
       val (buf, i, sz) = Word8ArraySlice.base sl
    in
       nonBlock
-      (fn () => Prim.recv (s, Word8Array.toPoly buf, i, sz,
-                           mk_in_flagsNB in_flags),
+      (fn () => Prim.recv (s, Word8Array.toPoly buf, i, C.Size.fromInt sz,
+                           Word.toInt (mk_in_flagsNB in_flags)),
        SOME, 
        NONE)
    end
@@ -529,8 +537,8 @@
       val a = Word8Array.rawArray n
    in
       nonBlock
-      (fn () => Prim.recv (s, Word8Array.toPoly a, 0, n,
-                           mk_in_flagsNB in_flags),
+      (fn () => Prim.recv (s, Word8Array.toPoly a, 0, C.Size.fromInt n,
+                           Word.toInt (mk_in_flagsNB in_flags)),
        fn bytesRead => SOME (getVec (a, n, bytesRead)),
        NONE)
    end
@@ -545,8 +553,8 @@
       val (sa, salen, finish) = new_sock_addr ()
    in
       nonBlock
-      (fn () => Prim.recvFrom (s, Word8Array.toPoly buf, i, sz,
-                               mk_in_flagsNB in_flags, sa, salen),
+      (fn () => Prim.recvFrom (s, Word8Array.toPoly buf, i, C.Size.fromInt sz,
+                               Word.toInt (mk_in_flagsNB in_flags), sa, salen),
        fn n => SOME (n, finish ()),
        NONE)
    end
@@ -557,8 +565,8 @@
       val (sa, salen, finish) = new_sock_addr ()
    in
       nonBlock
-      (fn () => Prim.recvFrom (s, Word8Array.toPoly a, 0, n,
-                               mk_in_flagsNB in_flags, sa, salen),
+      (fn () => Prim.recvFrom (s, Word8Array.toPoly a, 0, C.Size.fromInt n,
+                               Word.toInt (mk_in_flagsNB in_flags), sa, salen),
        fn bytesRead => SOME (getVec (a, n, bytesRead), finish ()),
        NONE)
    end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/net/unix-sock.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/net/unix-sock.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/net/unix-sock.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -7,19 +7,21 @@
 
 structure UnixSock : UNIX_SOCK =
    struct
-      structure Prim = Primitive.Socket.UnixSock
+      structure Prim = PrimitiveFFI.Socket.UnixSock
 
       datatype unix = UNIX
       type 'sock_type sock = (unix, 'sock_type) Socket.sock
       type 'mode stream_sock = 'mode Socket.stream sock
       type dgram_sock = Socket.dgram sock
       type sock_addr = unix Socket.sock_addr
-      val unixAF = NetHostDB.intToAddrFamily Primitive.Socket.AF.UNIX
+      val unixAF = NetHostDB.intToAddrFamily PrimitiveFFI.Socket.AF.UNIX
 
       fun toAddr s = 
         let
           val (sa, salen, finish) = Socket.new_sock_addr ()
-          val _ = Prim.toAddr (NullString.nullTerm s, String.size s, sa, salen)
+          val _ = Prim.toAddr (NullString.nullTerm s, 
+                               C.Size.fromInt (String.size s), 
+                               sa, salen)
         in 
           finish ()
         end
@@ -29,10 +31,10 @@
           val sa = Socket.unpackSockAddr sa
           val sa = Word8Vector.toPoly sa
           val len = Prim.pathLen sa
-          val a = CharArray.array (len, #"\000")
+          val a = CharArray.array (C.Size.toInt len, #"\000")
           val _ = Prim.fromAddr (sa, CharArray.toPoly a, len)
         in
-           CharArraySlice.vector (CharArraySlice.slice (a, 0, SOME len))
+           CharArraySlice.vector (CharArraySlice.slice (a, 0, SOME (C.Size.toInt len)))
         end 
 
       structure Strm =

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/posix/io.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/posix/io.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/posix/io.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -80,15 +80,6 @@
    fn SEEK_SET => Prim.SEEK_SET
     | SEEK_CUR => Prim.SEEK_CUR
     | SEEK_END => Prim.SEEK_END
-
-fun intToWhence n =
-   if n = Prim.SEEK_SET
-      then SEEK_SET
-   else if n = Prim.SEEK_CUR
-           then SEEK_CUR
-        else if n = Prim.SEEK_END
-                then SEEK_END
-             else raise Fail "Posix.IO.intToWhence"
                       
 fun lseek (fd, n: Position.int, w: whence): Position.int =
    SysCall.syscall

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/posix/stub-mingw.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/posix/stub-mingw.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/posix/stub-mingw.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -19,23 +19,6 @@
                        ; Error.raiseSys Error.nosys)
       else f
 in
-   structure Primitive =
-      struct
-         open Primitive
-
-         structure Socket =
-            struct
-               open Socket
-
-               structure UnixSock =
-                  struct
-                     open UnixSock
-
-                     val toAddr = stub ("toAddr", toAddr)
-                     val fromAddr = stub ("fromAddr", fromAddr)
-                  end
-            end
-      end
    structure PrimitiveFFI =
       struct
          open PrimitiveFFI
@@ -155,5 +138,18 @@
                         end
                   end
             end
+
+         structure Socket =
+            struct
+               open Socket
+                  
+               structure UnixSock =
+                  struct
+                     open UnixSock
+                        
+                     val toAddr = stub ("toAddr", toAddr)
+                     val fromAddr = stub ("fromAddr", fromAddr)
+                  end
+            end
       end
 end

Added: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/basis-ffi.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -0,0 +1,1000 @@
+(* This file is automatically generated.  Do not edit. *)
+
+structure PrimitiveFFI =
+struct
+structure CommandLine = 
+struct
+val (argcGet, argcSet) = _symbol "CommandLine_argc": (unit -> (C.Int.t)) * ((C.Int.t) -> unit);
+val (argvGet, argvSet) = _symbol "CommandLine_argv": (unit -> (C.StringArray.t)) * ((C.StringArray.t) -> unit);
+val (commandNameGet, commandNameSet) = _symbol "CommandLine_commandName": (unit -> (C.String.t)) * ((C.String.t) -> unit);
+end
+structure Date = 
+struct
+val gmTime = _import "Date_gmTime" : (C.Time.t) ref -> (C.Int.t) C.Errno.t;
+val localOffset = _import "Date_localOffset" : unit -> C.Double.t;
+val localTime = _import "Date_localTime" : (C.Time.t) ref -> (C.Int.t) C.Errno.t;
+val mkTime = _import "Date_mkTime" : unit -> (C.Time.t) C.Errno.t;
+val strfTime = _import "Date_strfTime" : (Char8.t) array * C.Size.t * NullString8.t -> C.Size.t;
+structure Tm = 
+struct
+val getHour = _import "Date_Tm_getHour" : unit -> C.Int.t;
+val getIsDst = _import "Date_Tm_getIsDst" : unit -> C.Int.t;
+val getMDay = _import "Date_Tm_getMDay" : unit -> C.Int.t;
+val getMin = _import "Date_Tm_getMin" : unit -> C.Int.t;
+val getMon = _import "Date_Tm_getMon" : unit -> C.Int.t;
+val getSec = _import "Date_Tm_getSec" : unit -> C.Int.t;
+val getWDay = _import "Date_Tm_getWDay" : unit -> C.Int.t;
+val getYDay = _import "Date_Tm_getYDay" : unit -> C.Int.t;
+val getYear = _import "Date_Tm_getYear" : unit -> C.Int.t;
+val setHour = _import "Date_Tm_setHour" : C.Int.t -> unit;
+val setIsDst = _import "Date_Tm_setIsDst" : C.Int.t -> unit;
+val setMDay = _import "Date_Tm_setMDay" : C.Int.t -> unit;
+val setMin = _import "Date_Tm_setMin" : C.Int.t -> unit;
+val setMon = _import "Date_Tm_setMon" : C.Int.t -> unit;
+val setSec = _import "Date_Tm_setSec" : C.Int.t -> unit;
+val setWDay = _import "Date_Tm_setWDay" : C.Int.t -> unit;
+val setYDay = _import "Date_Tm_setYDay" : C.Int.t -> unit;
+val setYear = _import "Date_Tm_setYear" : C.Int.t -> unit;
+end
+end
+structure IEEEReal = 
+struct
+val getRoundingMode = _import "IEEEReal_getRoundingMode" : unit -> C.Int.t;
+structure RoundingMode = 
+struct
+val FE_DOWNWARD = _const "IEEEReal_RoundingMode_FE_DOWNWARD" : C.Int.t;
+val FE_NOSUPPORT = _const "IEEEReal_RoundingMode_FE_NOSUPPORT" : C.Int.t;
+val FE_TONEAREST = _const "IEEEReal_RoundingMode_FE_TONEAREST" : C.Int.t;
+val FE_TOWARDZERO = _const "IEEEReal_RoundingMode_FE_TOWARDZERO" : C.Int.t;
+val FE_UPWARD = _const "IEEEReal_RoundingMode_FE_UPWARD" : C.Int.t;
+end
+val setRoundingMode = _import "IEEEReal_setRoundingMode" : C.Int.t -> unit;
+end
+structure MLton = 
+struct
+structure Itimer = 
+struct
+val PROF = _const "MLton_Itimer_PROF" : C.Int.t;
+val REAL = _const "MLton_Itimer_REAL" : C.Int.t;
+val set = _import "MLton_Itimer_set" : C.Int.t * C.Time.t * C.SUSeconds.t * C.Time.t * C.SUSeconds.t -> (C.Int.t) C.Errno.t;
+val VIRTUAL = _const "MLton_Itimer_VIRTUAL" : C.Int.t;
+end
+structure Process = 
+struct
+val cwait = _import "MLton_Process_cwait" : C.PId.t * (C.Status.t) ref -> (C.PId.t) C.Errno.t;
+val spawne = _import "MLton_Process_spawne" : NullString8.t * NullString8Array.t * NullString8Array.t -> (C.Int.t) C.Errno.t;
+val spawnp = _import "MLton_Process_spawnp" : NullString8.t * NullString8Array.t -> (C.Int.t) C.Errno.t;
+end
+structure Rlimit = 
+struct
+val AS = _const "MLton_Rlimit_AS" : C.Int.t;
+val CORE = _const "MLton_Rlimit_CORE" : C.Int.t;
+val CPU = _const "MLton_Rlimit_CPU" : C.Int.t;
+val DATA = _const "MLton_Rlimit_DATA" : C.Int.t;
+val FSIZE = _const "MLton_Rlimit_FSIZE" : C.Int.t;
+val get = _import "MLton_Rlimit_get" : C.Int.t -> (C.Int.t) C.Errno.t;
+val getHard = _import "MLton_Rlimit_getHard" : unit -> C.RLim.t;
+val getSoft = _import "MLton_Rlimit_getSoft" : unit -> C.RLim.t;
+val INFINITY = _const "MLton_Rlimit_INFINITY" : C.RLim.t;
+val NOFILE = _const "MLton_Rlimit_NOFILE" : C.Int.t;
+val set = _import "MLton_Rlimit_set" : C.Int.t * C.RLim.t * C.RLim.t -> (C.Int.t) C.Errno.t;
+val STACK = _const "MLton_Rlimit_STACK" : C.Int.t;
+end
+structure Rusage = 
+struct
+val children_stime_sec = _import "MLton_Rusage_children_stime_sec" : unit -> C.Time.t;
+val children_stime_usec = _import "MLton_Rusage_children_stime_usec" : unit -> C.SUSeconds.t;
+val children_utime_sec = _import "MLton_Rusage_children_utime_sec" : unit -> C.Time.t;
+val children_utime_usec = _import "MLton_Rusage_children_utime_usec" : unit -> C.SUSeconds.t;
+val gc_stime_sec = _import "MLton_Rusage_gc_stime_sec" : unit -> C.Time.t;
+val gc_stime_usec = _import "MLton_Rusage_gc_stime_usec" : unit -> C.SUSeconds.t;
+val gc_utime_sec = _import "MLton_Rusage_gc_utime_sec" : unit -> C.Time.t;
+val gc_utime_usec = _import "MLton_Rusage_gc_utime_usec" : unit -> C.SUSeconds.t;
+val getrusage = _import "MLton_Rusage_getrusage" : unit -> unit;
+val self_stime_sec = _import "MLton_Rusage_self_stime_sec" : unit -> C.Time.t;
+val self_stime_usec = _import "MLton_Rusage_self_stime_usec" : unit -> C.SUSeconds.t;
+val self_utime_sec = _import "MLton_Rusage_self_utime_sec" : unit -> C.Time.t;
+val self_utime_usec = _import "MLton_Rusage_self_utime_usec" : unit -> C.SUSeconds.t;
+end
+structure Syslog = 
+struct
+val closelog = _import "MLton_Syslog_closelog" : unit -> unit;
+structure Facility = 
+struct
+val LOG_AUTH = _const "MLton_Syslog_Facility_LOG_AUTH" : C.Int.t;
+val LOG_CRON = _const "MLton_Syslog_Facility_LOG_CRON" : C.Int.t;
+val LOG_DAEMON = _const "MLton_Syslog_Facility_LOG_DAEMON" : C.Int.t;
+val LOG_KERN = _const "MLton_Syslog_Facility_LOG_KERN" : C.Int.t;
+val LOG_LOCAL0 = _const "MLton_Syslog_Facility_LOG_LOCAL0" : C.Int.t;
+val LOG_LOCAL1 = _const "MLton_Syslog_Facility_LOG_LOCAL1" : C.Int.t;
+val LOG_LOCAL2 = _const "MLton_Syslog_Facility_LOG_LOCAL2" : C.Int.t;
+val LOG_LOCAL3 = _const "MLton_Syslog_Facility_LOG_LOCAL3" : C.Int.t;
+val LOG_LOCAL4 = _const "MLton_Syslog_Facility_LOG_LOCAL4" : C.Int.t;
+val LOG_LOCAL5 = _const "MLton_Syslog_Facility_LOG_LOCAL5" : C.Int.t;
+val LOG_LOCAL6 = _const "MLton_Syslog_Facility_LOG_LOCAL6" : C.Int.t;
+val LOG_LOCAL7 = _const "MLton_Syslog_Facility_LOG_LOCAL7" : C.Int.t;
+val LOG_LPR = _const "MLton_Syslog_Facility_LOG_LPR" : C.Int.t;
+val LOG_MAIL = _const "MLton_Syslog_Facility_LOG_MAIL" : C.Int.t;
+val LOG_NEWS = _const "MLton_Syslog_Facility_LOG_NEWS" : C.Int.t;
+val LOG_USER = _const "MLton_Syslog_Facility_LOG_USER" : C.Int.t;
+val LOG_UUCP = _const "MLton_Syslog_Facility_LOG_UUCP" : C.Int.t;
+end
+structure Logopt = 
+struct
+val LOG_CONS = _const "MLton_Syslog_Logopt_LOG_CONS" : C.Int.t;
+val LOG_NDELAY = _const "MLton_Syslog_Logopt_LOG_NDELAY" : C.Int.t;
+val LOG_NOWAIT = _const "MLton_Syslog_Logopt_LOG_NOWAIT" : C.Int.t;
+val LOG_ODELAY = _const "MLton_Syslog_Logopt_LOG_ODELAY" : C.Int.t;
+val LOG_PID = _const "MLton_Syslog_Logopt_LOG_PID" : C.Int.t;
+end
+val openlog = _import "MLton_Syslog_openlog" : NullString8.t * C.Int.t * C.Int.t -> unit;
+structure Severity = 
+struct
+val LOG_ALERT = _const "MLton_Syslog_Severity_LOG_ALERT" : C.Int.t;
+val LOG_CRIT = _const "MLton_Syslog_Severity_LOG_CRIT" : C.Int.t;
+val LOG_DEBUG = _const "MLton_Syslog_Severity_LOG_DEBUG" : C.Int.t;
+val LOG_EMERG = _const "MLton_Syslog_Severity_LOG_EMERG" : C.Int.t;
+val LOG_ERR = _const "MLton_Syslog_Severity_LOG_ERR" : C.Int.t;
+val LOG_INFO = _const "MLton_Syslog_Severity_LOG_INFO" : C.Int.t;
+val LOG_NOTICE = _const "MLton_Syslog_Severity_LOG_NOTICE" : C.Int.t;
+val LOG_WARNING = _const "MLton_Syslog_Severity_LOG_WARNING" : C.Int.t;
+end
+val syslog = _import "MLton_Syslog_syslog" : C.Int.t * NullString8.t -> unit;
+end
+end
+structure Net = 
+struct
+val htonl = _import "Net_htonl" : Word32.t -> Word32.t;
+val htons = _import "Net_htons" : Word16.t -> Word16.t;
+val ntohl = _import "Net_ntohl" : Word32.t -> Word32.t;
+val ntohs = _import "Net_ntohs" : Word16.t -> Word16.t;
+end
+structure NetHostDB = 
+struct
+val getByAddress = _import "NetHostDB_getByAddress" : (Word8.t) vector * C.Socklen.t -> Bool.t;
+val getByName = _import "NetHostDB_getByName" : NullString8.t -> Bool.t;
+val getEntryAddrsN = _import "NetHostDB_getEntryAddrsN" : C.Int.t * (Word8.t) array -> unit;
+val getEntryAddrsNum = _import "NetHostDB_getEntryAddrsNum" : unit -> C.Int.t;
+val getEntryAddrType = _import "NetHostDB_getEntryAddrType" : unit -> C.Int.t;
+val getEntryAliasesN = _import "NetHostDB_getEntryAliasesN" : C.Int.t -> C.String.t;
+val getEntryAliasesNum = _import "NetHostDB_getEntryAliasesNum" : unit -> C.Int.t;
+val getEntryLength = _import "NetHostDB_getEntryLength" : unit -> C.Int.t;
+val getEntryName = _import "NetHostDB_getEntryName" : unit -> C.String.t;
+val getHostName = _import "NetHostDB_getHostName" : (Char8.t) array * C.Size.t -> (C.Int.t) C.Errno.t;
+val INADDR_ANY = _const "NetHostDB_INADDR_ANY" : C.Int.t;
+val inAddrSize = _const "NetHostDB_inAddrSize" : C.Size.t;
+end
+structure NetProtDB = 
+struct
+val getByName = _import "NetProtDB_getByName" : NullString8.t -> Bool.t;
+val getByNumber = _import "NetProtDB_getByNumber" : C.Int.t -> Bool.t;
+val getEntryAliasesN = _import "NetProtDB_getEntryAliasesN" : C.Int.t -> C.String.t;
+val getEntryAliasesNum = _import "NetProtDB_getEntryAliasesNum" : unit -> C.Int.t;
+val getEntryName = _import "NetProtDB_getEntryName" : unit -> C.String.t;
+val getEntryProto = _import "NetProtDB_getEntryProto" : unit -> C.Int.t;
+end
+structure NetServDB = 
+struct
+val getByName = _import "NetServDB_getByName" : NullString8.t * NullString8.t -> Bool.t;
+val getByNameNull = _import "NetServDB_getByNameNull" : NullString8.t -> Bool.t;
+val getByPort = _import "NetServDB_getByPort" : C.Int.t * NullString8.t -> Bool.t;
+val getByPortNull = _import "NetServDB_getByPortNull" : C.Int.t -> Bool.t;
+val getEntryAliasesN = _import "NetServDB_getEntryAliasesN" : C.Int.t -> C.String.t;
+val getEntryAliasesNum = _import "NetServDB_getEntryAliasesNum" : unit -> C.Int.t;
+val getEntryName = _import "NetServDB_getEntryName" : unit -> C.String.t;
+val getEntryPort = _import "NetServDB_getEntryPort" : unit -> C.Int.t;
+val getEntryProto = _import "NetServDB_getEntryProto" : unit -> C.String.t;
+end
+structure OS = 
+struct
+structure IO = 
+struct
+val poll = _import "OS_IO_poll" : (C.Fd.t) vector * (C.Short.t) vector * C.NFds.t * C.Int.t * (C.Short.t) array -> (C.Int.t) C.Errno.t;
+val POLLIN = _const "OS_IO_POLLIN" : C.Short.t;
+val POLLOUT = _const "OS_IO_POLLOUT" : C.Short.t;
+val POLLPRI = _const "OS_IO_POLLPRI" : C.Short.t;
+end
+end
+structure Posix = 
+struct
+structure Error = 
+struct
+val clearErrno = _import "Posix_Error_clearErrno" : unit -> unit;
+val E2BIG = _const "Posix_Error_E2BIG" : C.Int.t;
+val EACCES = _const "Posix_Error_EACCES" : C.Int.t;
+val EADDRINUSE = _const "Posix_Error_EADDRINUSE" : C.Int.t;
+val EADDRNOTAVAIL = _const "Posix_Error_EADDRNOTAVAIL" : C.Int.t;
+val EAFNOSUPPORT = _const "Posix_Error_EAFNOSUPPORT" : C.Int.t;
+val EAGAIN = _const "Posix_Error_EAGAIN" : C.Int.t;
+val EALREADY = _const "Posix_Error_EALREADY" : C.Int.t;
+val EBADF = _const "Posix_Error_EBADF" : C.Int.t;
+val EBADMSG = _const "Posix_Error_EBADMSG" : C.Int.t;
+val EBUSY = _const "Posix_Error_EBUSY" : C.Int.t;
+val ECANCELED = _const "Posix_Error_ECANCELED" : C.Int.t;
+val ECHILD = _const "Posix_Error_ECHILD" : C.Int.t;
+val ECONNABORTED = _const "Posix_Error_ECONNABORTED" : C.Int.t;
+val ECONNREFUSED = _const "Posix_Error_ECONNREFUSED" : C.Int.t;
+val ECONNRESET = _const "Posix_Error_ECONNRESET" : C.Int.t;
+val EDEADLK = _const "Posix_Error_EDEADLK" : C.Int.t;
+val EDESTADDRREQ = _const "Posix_Error_EDESTADDRREQ" : C.Int.t;
+val EDOM = _const "Posix_Error_EDOM" : C.Int.t;
+val EDQUOT = _const "Posix_Error_EDQUOT" : C.Int.t;
+val EEXIST = _const "Posix_Error_EEXIST" : C.Int.t;
+val EFAULT = _const "Posix_Error_EFAULT" : C.Int.t;
+val EFBIG = _const "Posix_Error_EFBIG" : C.Int.t;
+val EHOSTUNREACH = _const "Posix_Error_EHOSTUNREACH" : C.Int.t;
+val EIDRM = _const "Posix_Error_EIDRM" : C.Int.t;
+val EILSEQ = _const "Posix_Error_EILSEQ" : C.Int.t;
+val EINPROGRESS = _const "Posix_Error_EINPROGRESS" : C.Int.t;
+val EINTR = _const "Posix_Error_EINTR" : C.Int.t;
+val EINVAL = _const "Posix_Error_EINVAL" : C.Int.t;
+val EIO = _const "Posix_Error_EIO" : C.Int.t;
+val EISCONN = _const "Posix_Error_EISCONN" : C.Int.t;
+val EISDIR = _const "Posix_Error_EISDIR" : C.Int.t;
+val ELOOP = _const "Posix_Error_ELOOP" : C.Int.t;
+val EMFILE = _const "Posix_Error_EMFILE" : C.Int.t;
+val EMLINK = _const "Posix_Error_EMLINK" : C.Int.t;
+val EMSGSIZE = _const "Posix_Error_EMSGSIZE" : C.Int.t;
+val EMULTIHOP = _const "Posix_Error_EMULTIHOP" : C.Int.t;
+val ENAMETOOLONG = _const "Posix_Error_ENAMETOOLONG" : C.Int.t;
+val ENETDOWN = _const "Posix_Error_ENETDOWN" : C.Int.t;
+val ENETRESET = _const "Posix_Error_ENETRESET" : C.Int.t;
+val ENETUNREACH = _const "Posix_Error_ENETUNREACH" : C.Int.t;
+val ENFILE = _const "Posix_Error_ENFILE" : C.Int.t;
+val ENOBUFS = _const "Posix_Error_ENOBUFS" : C.Int.t;
+val ENODATA = _const "Posix_Error_ENODATA" : C.Int.t;
+val ENODEV = _const "Posix_Error_ENODEV" : C.Int.t;
+val ENOENT = _const "Posix_Error_ENOENT" : C.Int.t;
+val ENOEXEC = _const "Posix_Error_ENOEXEC" : C.Int.t;
+val ENOLCK = _const "Posix_Error_ENOLCK" : C.Int.t;
+val ENOLINK = _const "Posix_Error_ENOLINK" : C.Int.t;
+val ENOMEM = _const "Posix_Error_ENOMEM" : C.Int.t;
+val ENOMSG = _const "Posix_Error_ENOMSG" : C.Int.t;
+val ENOPROTOOPT = _const "Posix_Error_ENOPROTOOPT" : C.Int.t;
+val ENOSPC = _const "Posix_Error_ENOSPC" : C.Int.t;
+val ENOSR = _const "Posix_Error_ENOSR" : C.Int.t;
+val ENOSTR = _const "Posix_Error_ENOSTR" : C.Int.t;
+val ENOSYS = _const "Posix_Error_ENOSYS" : C.Int.t;
+val ENOTCONN = _const "Posix_Error_ENOTCONN" : C.Int.t;
+val ENOTDIR = _const "Posix_Error_ENOTDIR" : C.Int.t;
+val ENOTEMPTY = _const "Posix_Error_ENOTEMPTY" : C.Int.t;
+val ENOTSOCK = _const "Posix_Error_ENOTSOCK" : C.Int.t;
+val ENOTSUP = _const "Posix_Error_ENOTSUP" : C.Int.t;
+val ENOTTY = _const "Posix_Error_ENOTTY" : C.Int.t;
+val ENXIO = _const "Posix_Error_ENXIO" : C.Int.t;
+val EOPNOTSUPP = _const "Posix_Error_EOPNOTSUPP" : C.Int.t;
+val EOVERFLOW = _const "Posix_Error_EOVERFLOW" : C.Int.t;
+val EPERM = _const "Posix_Error_EPERM" : C.Int.t;
+val EPIPE = _const "Posix_Error_EPIPE" : C.Int.t;
+val EPROTO = _const "Posix_Error_EPROTO" : C.Int.t;
+val EPROTONOSUPPORT = _const "Posix_Error_EPROTONOSUPPORT" : C.Int.t;
+val EPROTOTYPE = _const "Posix_Error_EPROTOTYPE" : C.Int.t;
+val ERANGE = _const "Posix_Error_ERANGE" : C.Int.t;
+val EROFS = _const "Posix_Error_EROFS" : C.Int.t;
+val ESPIPE = _const "Posix_Error_ESPIPE" : C.Int.t;
+val ESRCH = _const "Posix_Error_ESRCH" : C.Int.t;
+val ESTALE = _const "Posix_Error_ESTALE" : C.Int.t;
+val ETIME = _const "Posix_Error_ETIME" : C.Int.t;
+val ETIMEDOUT = _const "Posix_Error_ETIMEDOUT" : C.Int.t;
+val ETXTBSY = _const "Posix_Error_ETXTBSY" : C.Int.t;
+val EWOULDBLOCK = _const "Posix_Error_EWOULDBLOCK" : C.Int.t;
+val EXDEV = _const "Posix_Error_EXDEV" : C.Int.t;
+val getErrno = _import "Posix_Error_getErrno" : unit -> C.Int.t;
+val strError = _import "Posix_Error_strError" : C.Int.t -> C.String.t;
+end
+structure FileSys = 
+struct
+structure A = 
+struct
+val F_OK = _const "Posix_FileSys_A_F_OK" : C.Int.t;
+val R_OK = _const "Posix_FileSys_A_R_OK" : C.Int.t;
+val W_OK = _const "Posix_FileSys_A_W_OK" : C.Int.t;
+val X_OK = _const "Posix_FileSys_A_X_OK" : C.Int.t;
+end
+val access = _import "Posix_FileSys_access" : NullString8.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val chdir = _import "Posix_FileSys_chdir" : NullString8.t -> (C.Int.t) C.Errno.t;
+val chmod = _import "Posix_FileSys_chmod" : NullString8.t * C.Mode.t -> (C.Int.t) C.Errno.t;
+val chown = _import "Posix_FileSys_chown" : NullString8.t * C.UId.t * C.GId.t -> (C.Int.t) C.Errno.t;
+structure Dirstream = 
+struct
+val closeDir = _import "Posix_FileSys_Dirstream_closeDir" : C.DirP.t -> (C.Int.t) C.Errno.t;
+val openDir = _import "Posix_FileSys_Dirstream_openDir" : NullString8.t -> (C.DirP.t) C.Errno.t;
+val readDir = _import "Posix_FileSys_Dirstream_readDir" : C.DirP.t -> (C.String.t) C.Errno.t;
+val rewindDir = _import "Posix_FileSys_Dirstream_rewindDir" : C.DirP.t -> unit;
+end
+val fchdir = _import "Posix_FileSys_fchdir" : C.Fd.t -> (C.Int.t) C.Errno.t;
+val fchmod = _import "Posix_FileSys_fchmod" : C.Fd.t * C.Mode.t -> (C.Int.t) C.Errno.t;
+val fchown = _import "Posix_FileSys_fchown" : C.Fd.t * C.UId.t * C.GId.t -> (C.Int.t) C.Errno.t;
+val fpathconf = _import "Posix_FileSys_fpathconf" : C.Fd.t * C.Int.t -> (C.Long.t) C.Errno.t;
+val ftruncate = _import "Posix_FileSys_ftruncate" : C.Fd.t * C.Off.t -> (C.Int.t) C.Errno.t;
+val getcwd = _import "Posix_FileSys_getcwd" : (Char8.t) array * C.Size.t -> (C.String.t) C.Errno.t;
+val link = _import "Posix_FileSys_link" : NullString8.t * NullString8.t -> (C.Int.t) C.Errno.t;
+val mkdir = _import "Posix_FileSys_mkdir" : NullString8.t * C.Mode.t -> (C.Int.t) C.Errno.t;
+val mkfifo = _import "Posix_FileSys_mkfifo" : NullString8.t * C.Mode.t -> (C.Int.t) C.Errno.t;
+structure O = 
+struct
+val APPEND = _const "Posix_FileSys_O_APPEND" : C.Int.t;
+val BINARY = _const "Posix_FileSys_O_BINARY" : C.Int.t;
+val CREAT = _const "Posix_FileSys_O_CREAT" : C.Int.t;
+val DSYNC = _const "Posix_FileSys_O_DSYNC" : C.Int.t;
+val EXCL = _const "Posix_FileSys_O_EXCL" : C.Int.t;
+val NOCTTY = _const "Posix_FileSys_O_NOCTTY" : C.Int.t;
+val NONBLOCK = _const "Posix_FileSys_O_NONBLOCK" : C.Int.t;
+val RDONLY = _const "Posix_FileSys_O_RDONLY" : C.Int.t;
+val RDWR = _const "Posix_FileSys_O_RDWR" : C.Int.t;
+val RSYNC = _const "Posix_FileSys_O_RSYNC" : C.Int.t;
+val SYNC = _const "Posix_FileSys_O_SYNC" : C.Int.t;
+val TEXT = _const "Posix_FileSys_O_TEXT" : C.Int.t;
+val TRUNC = _const "Posix_FileSys_O_TRUNC" : C.Int.t;
+val WRONLY = _const "Posix_FileSys_O_WRONLY" : C.Int.t;
+end
+val open2 = _import "Posix_FileSys_open2" : NullString8.t * C.Int.t -> (C.Fd.t) C.Errno.t;
+val open3 = _import "Posix_FileSys_open3" : NullString8.t * C.Int.t * C.Mode.t -> (C.Fd.t) C.Errno.t;
+val pathconf = _import "Posix_FileSys_pathconf" : NullString8.t * C.Int.t -> (C.Long.t) C.Errno.t;
+structure PC = 
+struct
+val ALLOC_SIZE_MIN = _const "Posix_FileSys_PC_ALLOC_SIZE_MIN" : C.Int.t;
+val ASYNC_IO = _const "Posix_FileSys_PC_ASYNC_IO" : C.Int.t;
+val CHOWN_RESTRICTED = _const "Posix_FileSys_PC_CHOWN_RESTRICTED" : C.Int.t;
+val FILESIZEBITS = _const "Posix_FileSys_PC_FILESIZEBITS" : C.Int.t;
+val LINK_MAX = _const "Posix_FileSys_PC_LINK_MAX" : C.Int.t;
+val MAX_CANON = _const "Posix_FileSys_PC_MAX_CANON" : C.Int.t;
+val MAX_INPUT = _const "Posix_FileSys_PC_MAX_INPUT" : C.Int.t;
+val NAME_MAX = _const "Posix_FileSys_PC_NAME_MAX" : C.Int.t;
+val NO_TRUNC = _const "Posix_FileSys_PC_NO_TRUNC" : C.Int.t;
+val PATH_MAX = _const "Posix_FileSys_PC_PATH_MAX" : C.Int.t;
+val PIPE_BUF = _const "Posix_FileSys_PC_PIPE_BUF" : C.Int.t;
+val PRIO_IO = _const "Posix_FileSys_PC_PRIO_IO" : C.Int.t;
+val REC_INCR_XFER_SIZE = _const "Posix_FileSys_PC_REC_INCR_XFER_SIZE" : C.Int.t;
+val REC_MAX_XFER_SIZE = _const "Posix_FileSys_PC_REC_MAX_XFER_SIZE" : C.Int.t;
+val REC_MIN_XFER_SIZE = _const "Posix_FileSys_PC_REC_MIN_XFER_SIZE" : C.Int.t;
+val REC_XFER_ALIGN = _const "Posix_FileSys_PC_REC_XFER_ALIGN" : C.Int.t;
+val SYMLINK_MAX = _const "Posix_FileSys_PC_SYMLINK_MAX" : C.Int.t;
+val SYNC_IO = _const "Posix_FileSys_PC_SYNC_IO" : C.Int.t;
+val VDISABLE = _const "Posix_FileSys_PC_VDISABLE" : C.Int.t;
+end
+val readlink = _import "Posix_FileSys_readlink" : NullString8.t * (Char8.t) array * C.Size.t -> (C.SSize.t) C.Errno.t;
+val rename = _import "Posix_FileSys_rename" : NullString8.t * NullString8.t -> (C.Int.t) C.Errno.t;
+val rmdir = _import "Posix_FileSys_rmdir" : NullString8.t -> (C.Int.t) C.Errno.t;
+structure S = 
+struct
+val IFBLK = _const "Posix_FileSys_S_IFBLK" : C.Mode.t;
+val IFCHR = _const "Posix_FileSys_S_IFCHR" : C.Mode.t;
+val IFDIR = _const "Posix_FileSys_S_IFDIR" : C.Mode.t;
+val IFIFO = _const "Posix_FileSys_S_IFIFO" : C.Mode.t;
+val IFLNK = _const "Posix_FileSys_S_IFLNK" : C.Mode.t;
+val IFMT = _const "Posix_FileSys_S_IFMT" : C.Mode.t;
+val IFREG = _const "Posix_FileSys_S_IFREG" : C.Mode.t;
+val IFSOCK = _const "Posix_FileSys_S_IFSOCK" : C.Mode.t;
+val IRGRP = _const "Posix_FileSys_S_IRGRP" : C.Mode.t;
+val IROTH = _const "Posix_FileSys_S_IROTH" : C.Mode.t;
+val IRUSR = _const "Posix_FileSys_S_IRUSR" : C.Mode.t;
+val IRWXG = _const "Posix_FileSys_S_IRWXG" : C.Mode.t;
+val IRWXO = _const "Posix_FileSys_S_IRWXO" : C.Mode.t;
+val IRWXU = _const "Posix_FileSys_S_IRWXU" : C.Mode.t;
+val ISGID = _const "Posix_FileSys_S_ISGID" : C.Mode.t;
+val ISUID = _const "Posix_FileSys_S_ISUID" : C.Mode.t;
+val ISVTX = _const "Posix_FileSys_S_ISVTX" : C.Mode.t;
+val IWGRP = _const "Posix_FileSys_S_IWGRP" : C.Mode.t;
+val IWOTH = _const "Posix_FileSys_S_IWOTH" : C.Mode.t;
+val IWUSR = _const "Posix_FileSys_S_IWUSR" : C.Mode.t;
+val IXGRP = _const "Posix_FileSys_S_IXGRP" : C.Mode.t;
+val IXOTH = _const "Posix_FileSys_S_IXOTH" : C.Mode.t;
+val IXUSR = _const "Posix_FileSys_S_IXUSR" : C.Mode.t;
+end
+structure ST = 
+struct
+val isBlk = _import "Posix_FileSys_ST_isBlk" : C.Mode.t -> Bool.t;
+val isChr = _import "Posix_FileSys_ST_isChr" : C.Mode.t -> Bool.t;
+val isDir = _import "Posix_FileSys_ST_isDir" : C.Mode.t -> Bool.t;
+val isFIFO = _import "Posix_FileSys_ST_isFIFO" : C.Mode.t -> Bool.t;
+val isLink = _import "Posix_FileSys_ST_isLink" : C.Mode.t -> Bool.t;
+val isReg = _import "Posix_FileSys_ST_isReg" : C.Mode.t -> Bool.t;
+val isSock = _import "Posix_FileSys_ST_isSock" : C.Mode.t -> Bool.t;
+end
+structure Stat = 
+struct
+val fstat = _import "Posix_FileSys_Stat_fstat" : C.Fd.t -> (C.Int.t) C.Errno.t;
+val getATime = _import "Posix_FileSys_Stat_getATime" : unit -> C.Time.t;
+val getCTime = _import "Posix_FileSys_Stat_getCTime" : unit -> C.Time.t;
+val getDev = _import "Posix_FileSys_Stat_getDev" : unit -> C.Dev.t;
+val getGId = _import "Posix_FileSys_Stat_getGId" : unit -> C.GId.t;
+val getINo = _import "Posix_FileSys_Stat_getINo" : unit -> C.INo.t;
+val getMode = _import "Posix_FileSys_Stat_getMode" : unit -> C.Mode.t;
+val getMTime = _import "Posix_FileSys_Stat_getMTime" : unit -> C.Time.t;
+val getNLink = _import "Posix_FileSys_Stat_getNLink" : unit -> C.NLink.t;
+val getRDev = _import "Posix_FileSys_Stat_getRDev" : unit -> C.Dev.t;
+val getSize = _import "Posix_FileSys_Stat_getSize" : unit -> C.Off.t;
+val getUId = _import "Posix_FileSys_Stat_getUId" : unit -> C.UId.t;
+val lstat = _import "Posix_FileSys_Stat_lstat" : NullString8.t -> (C.Int.t) C.Errno.t;
+val stat = _import "Posix_FileSys_Stat_stat" : NullString8.t -> (C.Int.t) C.Errno.t;
+end
+val symlink = _import "Posix_FileSys_symlink" : NullString8.t * NullString8.t -> (C.Int.t) C.Errno.t;
+val truncate = _import "Posix_FileSys_truncate" : NullString8.t * C.Off.t -> (C.Int.t) C.Errno.t;
+val umask = _import "Posix_FileSys_umask" : C.Mode.t -> C.Mode.t;
+val unlink = _import "Posix_FileSys_unlink" : NullString8.t -> (C.Int.t) C.Errno.t;
+structure Utimbuf = 
+struct
+val setAcTime = _import "Posix_FileSys_Utimbuf_setAcTime" : C.Time.t -> unit;
+val setModTime = _import "Posix_FileSys_Utimbuf_setModTime" : C.Time.t -> unit;
+val utime = _import "Posix_FileSys_Utimbuf_utime" : NullString8.t -> (C.Int.t) C.Errno.t;
+end
+end
+structure IO = 
+struct
+val close = _import "Posix_IO_close" : C.Fd.t -> (C.Int.t) C.Errno.t;
+val dup = _import "Posix_IO_dup" : C.Fd.t -> (C.Fd.t) C.Errno.t;
+val dup2 = _import "Posix_IO_dup2" : C.Fd.t * C.Fd.t -> (C.Fd.t) C.Errno.t;
+val F_DUPFD = _const "Posix_IO_F_DUPFD" : C.Int.t;
+val F_GETFD = _const "Posix_IO_F_GETFD" : C.Int.t;
+val F_GETFL = _const "Posix_IO_F_GETFL" : C.Int.t;
+val F_GETOWN = _const "Posix_IO_F_GETOWN" : C.Int.t;
+val F_SETFD = _const "Posix_IO_F_SETFD" : C.Int.t;
+val F_SETFL = _const "Posix_IO_F_SETFL" : C.Int.t;
+val F_SETOWN = _const "Posix_IO_F_SETOWN" : C.Int.t;
+val fcntl2 = _import "Posix_IO_fcntl2" : C.Fd.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val fcntl3 = _import "Posix_IO_fcntl3" : C.Fd.t * C.Int.t * C.Int.t -> (C.Int.t) C.Errno.t;
+structure FD = 
+struct
+val CLOEXEC = _const "Posix_IO_FD_CLOEXEC" : C.Fd.t;
+end
+structure FLock = 
+struct
+val F_GETLK = _const "Posix_IO_FLock_F_GETLK" : C.Int.t;
+val F_RDLCK = _const "Posix_IO_FLock_F_RDLCK" : C.Short.t;
+val F_SETLK = _const "Posix_IO_FLock_F_SETLK" : C.Int.t;
+val F_SETLKW = _const "Posix_IO_FLock_F_SETLKW" : C.Int.t;
+val F_UNLCK = _const "Posix_IO_FLock_F_UNLCK" : C.Short.t;
+val F_WRLCK = _const "Posix_IO_FLock_F_WRLCK" : C.Short.t;
+val fcntl = _import "Posix_IO_FLock_fcntl" : C.Fd.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val getLen = _import "Posix_IO_FLock_getLen" : unit -> C.Off.t;
+val getPId = _import "Posix_IO_FLock_getPId" : unit -> C.PId.t;
+val getStart = _import "Posix_IO_FLock_getStart" : unit -> C.Off.t;
+val getType = _import "Posix_IO_FLock_getType" : unit -> C.Short.t;
+val getWhence = _import "Posix_IO_FLock_getWhence" : unit -> C.Short.t;
+val SEEK_CUR = _const "Posix_IO_FLock_SEEK_CUR" : C.Short.t;
+val SEEK_END = _const "Posix_IO_FLock_SEEK_END" : C.Short.t;
+val SEEK_SET = _const "Posix_IO_FLock_SEEK_SET" : C.Short.t;
+val setLen = _import "Posix_IO_FLock_setLen" : C.Off.t -> unit;
+val setPId = _import "Posix_IO_FLock_setPId" : C.PId.t -> unit;
+val setStart = _import "Posix_IO_FLock_setStart" : C.Off.t -> unit;
+val setType = _import "Posix_IO_FLock_setType" : C.Short.t -> unit;
+val setWhence = _import "Posix_IO_FLock_setWhence" : C.Short.t -> unit;
+end
+val fsync = _import "Posix_IO_fsync" : C.Fd.t -> (C.Int.t) C.Errno.t;
+val lseek = _import "Posix_IO_lseek" : C.Fd.t * C.Off.t * C.Int.t -> (C.Off.t) C.Errno.t;
+val O_ACCMODE = _const "Posix_IO_O_ACCMODE" : C.Int.t;
+val pipe = _import "Posix_IO_pipe" : (C.Fd.t) array -> (C.Int.t) C.Errno.t;
+val readChar8 = _import "Posix_IO_readChar8" : C.Fd.t * (Char8.t) array * C.Int.t * C.Size.t -> (C.SSize.t) C.Errno.t;
+val readWord8 = _import "Posix_IO_readWord8" : C.Fd.t * (Word8.t) array * C.Int.t * C.Size.t -> (C.SSize.t) C.Errno.t;
+val SEEK_CUR = _const "Posix_IO_SEEK_CUR" : C.Int.t;
+val SEEK_END = _const "Posix_IO_SEEK_END" : C.Int.t;
+val SEEK_SET = _const "Posix_IO_SEEK_SET" : C.Int.t;
+val setbin = _import "Posix_IO_setbin" : C.Fd.t -> unit;
+val settext = _import "Posix_IO_settext" : C.Fd.t -> unit;
+val writeChar8Arr = _import "Posix_IO_writeChar8Arr" : C.Fd.t * (Char8.t) array * C.Int.t * C.Size.t -> (C.SSize.t) C.Errno.t;
+val writeChar8Vec = _import "Posix_IO_writeChar8Vec" : C.Fd.t * (Char8.t) vector * C.Int.t * C.Size.t -> (C.SSize.t) C.Errno.t;
+val writeWord8Arr = _import "Posix_IO_writeWord8Arr" : C.Fd.t * (Word8.t) array * C.Int.t * C.Size.t -> (C.SSize.t) C.Errno.t;
+val writeWord8Vec = _import "Posix_IO_writeWord8Vec" : C.Fd.t * (Word8.t) vector * C.Int.t * C.Size.t -> (C.SSize.t) C.Errno.t;
+end
+structure ProcEnv = 
+struct
+val ctermid = _import "Posix_ProcEnv_ctermid" : unit -> C.String.t;
+val (environGet, environSet) = _symbol "Posix_ProcEnv_environ": (unit -> (C.StringArray.t)) * ((C.StringArray.t) -> unit);
+val getegid = _import "Posix_ProcEnv_getegid" : unit -> C.GId.t;
+val getenv = _import "Posix_ProcEnv_getenv" : NullString8.t -> C.String.t;
+val geteuid = _import "Posix_ProcEnv_geteuid" : unit -> C.UId.t;
+val getgid = _import "Posix_ProcEnv_getgid" : unit -> C.GId.t;
+val getgroups = _import "Posix_ProcEnv_getgroups" : C.Int.t * (C.GId.t) array -> (C.Int.t) C.Errno.t;
+val getgroupsN = _import "Posix_ProcEnv_getgroupsN" : unit -> C.Int.t;
+val getlogin = _import "Posix_ProcEnv_getlogin" : unit -> (C.String.t) C.Errno.t;
+val getpgrp = _import "Posix_ProcEnv_getpgrp" : unit -> C.PId.t;
+val getpid = _import "Posix_ProcEnv_getpid" : unit -> C.PId.t;
+val getppid = _import "Posix_ProcEnv_getppid" : unit -> C.PId.t;
+val getuid = _import "Posix_ProcEnv_getuid" : unit -> C.UId.t;
+val isatty = _import "Posix_ProcEnv_isatty" : C.Fd.t -> Bool.t;
+val SC_2_C_BIND = _const "Posix_ProcEnv_SC_2_C_BIND" : C.Int.t;
+val SC_2_C_DEV = _const "Posix_ProcEnv_SC_2_C_DEV" : C.Int.t;
+val SC_2_CHAR_TERM = _const "Posix_ProcEnv_SC_2_CHAR_TERM" : C.Int.t;
+val SC_2_FORT_DEV = _const "Posix_ProcEnv_SC_2_FORT_DEV" : C.Int.t;
+val SC_2_FORT_RUN = _const "Posix_ProcEnv_SC_2_FORT_RUN" : C.Int.t;
+val SC_2_LOCALEDEF = _const "Posix_ProcEnv_SC_2_LOCALEDEF" : C.Int.t;
+val SC_2_PBS = _const "Posix_ProcEnv_SC_2_PBS" : C.Int.t;
+val SC_2_PBS_ACCOUNTING = _const "Posix_ProcEnv_SC_2_PBS_ACCOUNTING" : C.Int.t;
+val SC_2_PBS_CHECKPOINT = _const "Posix_ProcEnv_SC_2_PBS_CHECKPOINT" : C.Int.t;
+val SC_2_PBS_LOCATE = _const "Posix_ProcEnv_SC_2_PBS_LOCATE" : C.Int.t;
+val SC_2_PBS_MESSAGE = _const "Posix_ProcEnv_SC_2_PBS_MESSAGE" : C.Int.t;
+val SC_2_PBS_TRACK = _const "Posix_ProcEnv_SC_2_PBS_TRACK" : C.Int.t;
+val SC_2_SW_DEV = _const "Posix_ProcEnv_SC_2_SW_DEV" : C.Int.t;
+val SC_2_UPE = _const "Posix_ProcEnv_SC_2_UPE" : C.Int.t;
+val SC_2_VERSION = _const "Posix_ProcEnv_SC_2_VERSION" : C.Int.t;
+val SC_ADVISORY_INFO = _const "Posix_ProcEnv_SC_ADVISORY_INFO" : C.Int.t;
+val SC_AIO_LISTIO_MAX = _const "Posix_ProcEnv_SC_AIO_LISTIO_MAX" : C.Int.t;
+val SC_AIO_MAX = _const "Posix_ProcEnv_SC_AIO_MAX" : C.Int.t;
+val SC_AIO_PRIO_DELTA_MAX = _const "Posix_ProcEnv_SC_AIO_PRIO_DELTA_MAX" : C.Int.t;
+val SC_ARG_MAX = _const "Posix_ProcEnv_SC_ARG_MAX" : C.Int.t;
+val SC_ASYNCHRONOUS_IO = _const "Posix_ProcEnv_SC_ASYNCHRONOUS_IO" : C.Int.t;
+val SC_ATEXIT_MAX = _const "Posix_ProcEnv_SC_ATEXIT_MAX" : C.Int.t;
+val SC_BARRIERS = _const "Posix_ProcEnv_SC_BARRIERS" : C.Int.t;
+val SC_BC_BASE_MAX = _const "Posix_ProcEnv_SC_BC_BASE_MAX" : C.Int.t;
+val SC_BC_DIM_MAX = _const "Posix_ProcEnv_SC_BC_DIM_MAX" : C.Int.t;
+val SC_BC_SCALE_MAX = _const "Posix_ProcEnv_SC_BC_SCALE_MAX" : C.Int.t;
+val SC_BC_STRING_MAX = _const "Posix_ProcEnv_SC_BC_STRING_MAX" : C.Int.t;
+val SC_CHILD_MAX = _const "Posix_ProcEnv_SC_CHILD_MAX" : C.Int.t;
+val SC_CLK_TCK = _const "Posix_ProcEnv_SC_CLK_TCK" : C.Int.t;
+val SC_CLOCK_SELECTION = _const "Posix_ProcEnv_SC_CLOCK_SELECTION" : C.Int.t;
+val SC_COLL_WEIGHTS_MAX = _const "Posix_ProcEnv_SC_COLL_WEIGHTS_MAX" : C.Int.t;
+val SC_CPUTIME = _const "Posix_ProcEnv_SC_CPUTIME" : C.Int.t;
+val SC_DELAYTIMER_MAX = _const "Posix_ProcEnv_SC_DELAYTIMER_MAX" : C.Int.t;
+val SC_EXPR_NEST_MAX = _const "Posix_ProcEnv_SC_EXPR_NEST_MAX" : C.Int.t;
+val SC_FSYNC = _const "Posix_ProcEnv_SC_FSYNC" : C.Int.t;
+val SC_GETGR_R_SIZE_MAX = _const "Posix_ProcEnv_SC_GETGR_R_SIZE_MAX" : C.Int.t;
+val SC_GETPW_R_SIZE_MAX = _const "Posix_ProcEnv_SC_GETPW_R_SIZE_MAX" : C.Int.t;
+val SC_HOST_NAME_MAX = _const "Posix_ProcEnv_SC_HOST_NAME_MAX" : C.Int.t;
+val SC_IOV_MAX = _const "Posix_ProcEnv_SC_IOV_MAX" : C.Int.t;
+val SC_IPV6 = _const "Posix_ProcEnv_SC_IPV6" : C.Int.t;
+val SC_JOB_CONTROL = _const "Posix_ProcEnv_SC_JOB_CONTROL" : C.Int.t;
+val SC_LINE_MAX = _const "Posix_ProcEnv_SC_LINE_MAX" : C.Int.t;
+val SC_LOGIN_NAME_MAX = _const "Posix_ProcEnv_SC_LOGIN_NAME_MAX" : C.Int.t;
+val SC_MAPPED_FILES = _const "Posix_ProcEnv_SC_MAPPED_FILES" : C.Int.t;
+val SC_MEMLOCK = _const "Posix_ProcEnv_SC_MEMLOCK" : C.Int.t;
+val SC_MEMLOCK_RANGE = _const "Posix_ProcEnv_SC_MEMLOCK_RANGE" : C.Int.t;
+val SC_MEMORY_PROTECTION = _const "Posix_ProcEnv_SC_MEMORY_PROTECTION" : C.Int.t;
+val SC_MESSAGE_PASSING = _const "Posix_ProcEnv_SC_MESSAGE_PASSING" : C.Int.t;
+val SC_MONOTONIC_CLOCK = _const "Posix_ProcEnv_SC_MONOTONIC_CLOCK" : C.Int.t;
+val SC_MQ_OPEN_MAX = _const "Posix_ProcEnv_SC_MQ_OPEN_MAX" : C.Int.t;
+val SC_MQ_PRIO_MAX = _const "Posix_ProcEnv_SC_MQ_PRIO_MAX" : C.Int.t;
+val SC_NGROUPS_MAX = _const "Posix_ProcEnv_SC_NGROUPS_MAX" : C.Int.t;
+val SC_OPEN_MAX = _const "Posix_ProcEnv_SC_OPEN_MAX" : C.Int.t;
+val SC_PAGE_SIZE = _const "Posix_ProcEnv_SC_PAGE_SIZE" : C.Int.t;
+val SC_PAGESIZE = _const "Posix_ProcEnv_SC_PAGESIZE" : C.Int.t;
+val SC_PRIORITIZED_IO = _const "Posix_ProcEnv_SC_PRIORITIZED_IO" : C.Int.t;
+val SC_PRIORITY_SCHEDULING = _const "Posix_ProcEnv_SC_PRIORITY_SCHEDULING" : C.Int.t;
+val SC_RAW_SOCKETS = _const "Posix_ProcEnv_SC_RAW_SOCKETS" : C.Int.t;
+val SC_RE_DUP_MAX = _const "Posix_ProcEnv_SC_RE_DUP_MAX" : C.Int.t;
+val SC_READER_WRITER_LOCKS = _const "Posix_ProcEnv_SC_READER_WRITER_LOCKS" : C.Int.t;
+val SC_REALTIME_SIGNALS = _const "Posix_ProcEnv_SC_REALTIME_SIGNALS" : C.Int.t;
+val SC_REGEXP = _const "Posix_ProcEnv_SC_REGEXP" : C.Int.t;
+val SC_RTSIG_MAX = _const "Posix_ProcEnv_SC_RTSIG_MAX" : C.Int.t;
+val SC_SAVED_IDS = _const "Posix_ProcEnv_SC_SAVED_IDS" : C.Int.t;
+val SC_SEM_NSEMS_MAX = _const "Posix_ProcEnv_SC_SEM_NSEMS_MAX" : C.Int.t;
+val SC_SEM_VALUE_MAX = _const "Posix_ProcEnv_SC_SEM_VALUE_MAX" : C.Int.t;
+val SC_SEMAPHORES = _const "Posix_ProcEnv_SC_SEMAPHORES" : C.Int.t;
+val SC_SHARED_MEMORY_OBJECTS = _const "Posix_ProcEnv_SC_SHARED_MEMORY_OBJECTS" : C.Int.t;
+val SC_SHELL = _const "Posix_ProcEnv_SC_SHELL" : C.Int.t;
+val SC_SIGQUEUE_MAX = _const "Posix_ProcEnv_SC_SIGQUEUE_MAX" : C.Int.t;
+val SC_SPAWN = _const "Posix_ProcEnv_SC_SPAWN" : C.Int.t;
+val SC_SPIN_LOCKS = _const "Posix_ProcEnv_SC_SPIN_LOCKS" : C.Int.t;
+val SC_SPORADIC_SERVER = _const "Posix_ProcEnv_SC_SPORADIC_SERVER" : C.Int.t;
+val SC_SS_REPL_MAX = _const "Posix_ProcEnv_SC_SS_REPL_MAX" : C.Int.t;
+val SC_STREAM_MAX = _const "Posix_ProcEnv_SC_STREAM_MAX" : C.Int.t;
+val SC_SYMLOOP_MAX = _const "Posix_ProcEnv_SC_SYMLOOP_MAX" : C.Int.t;
+val SC_SYNCHRONIZED_IO = _const "Posix_ProcEnv_SC_SYNCHRONIZED_IO" : C.Int.t;
+val SC_THREAD_ATTR_STACKADDR = _const "Posix_ProcEnv_SC_THREAD_ATTR_STACKADDR" : C.Int.t;
+val SC_THREAD_ATTR_STACKSIZE = _const "Posix_ProcEnv_SC_THREAD_ATTR_STACKSIZE" : C.Int.t;
+val SC_THREAD_CPUTIME = _const "Posix_ProcEnv_SC_THREAD_CPUTIME" : C.Int.t;
+val SC_THREAD_DESTRUCTOR_ITERATIONS = _const "Posix_ProcEnv_SC_THREAD_DESTRUCTOR_ITERATIONS" : C.Int.t;
+val SC_THREAD_KEYS_MAX = _const "Posix_ProcEnv_SC_THREAD_KEYS_MAX" : C.Int.t;
+val SC_THREAD_PRIO_INHERIT = _const "Posix_ProcEnv_SC_THREAD_PRIO_INHERIT" : C.Int.t;
+val SC_THREAD_PRIO_PROTECT = _const "Posix_ProcEnv_SC_THREAD_PRIO_PROTECT" : C.Int.t;
+val SC_THREAD_PRIORITY_SCHEDULING = _const "Posix_ProcEnv_SC_THREAD_PRIORITY_SCHEDULING" : C.Int.t;
+val SC_THREAD_PROCESS_SHARED = _const "Posix_ProcEnv_SC_THREAD_PROCESS_SHARED" : C.Int.t;
+val SC_THREAD_SAFE_FUNCTIONS = _const "Posix_ProcEnv_SC_THREAD_SAFE_FUNCTIONS" : C.Int.t;
+val SC_THREAD_SPORADIC_SERVER = _const "Posix_ProcEnv_SC_THREAD_SPORADIC_SERVER" : C.Int.t;
+val SC_THREAD_STACK_MIN = _const "Posix_ProcEnv_SC_THREAD_STACK_MIN" : C.Int.t;
+val SC_THREAD_THREADS_MAX = _const "Posix_ProcEnv_SC_THREAD_THREADS_MAX" : C.Int.t;
+val SC_THREADS = _const "Posix_ProcEnv_SC_THREADS" : C.Int.t;
+val SC_TIMEOUTS = _const "Posix_ProcEnv_SC_TIMEOUTS" : C.Int.t;
+val SC_TIMER_MAX = _const "Posix_ProcEnv_SC_TIMER_MAX" : C.Int.t;
+val SC_TIMERS = _const "Posix_ProcEnv_SC_TIMERS" : C.Int.t;
+val SC_TRACE = _const "Posix_ProcEnv_SC_TRACE" : C.Int.t;
+val SC_TRACE_EVENT_FILTER = _const "Posix_ProcEnv_SC_TRACE_EVENT_FILTER" : C.Int.t;
+val SC_TRACE_EVENT_NAME_MAX = _const "Posix_ProcEnv_SC_TRACE_EVENT_NAME_MAX" : C.Int.t;
+val SC_TRACE_INHERIT = _const "Posix_ProcEnv_SC_TRACE_INHERIT" : C.Int.t;
+val SC_TRACE_LOG = _const "Posix_ProcEnv_SC_TRACE_LOG" : C.Int.t;
+val SC_TRACE_NAME_MAX = _const "Posix_ProcEnv_SC_TRACE_NAME_MAX" : C.Int.t;
+val SC_TRACE_SYS_MAX = _const "Posix_ProcEnv_SC_TRACE_SYS_MAX" : C.Int.t;
+val SC_TRACE_USER_EVENT_MAX = _const "Posix_ProcEnv_SC_TRACE_USER_EVENT_MAX" : C.Int.t;
+val SC_TTY_NAME_MAX = _const "Posix_ProcEnv_SC_TTY_NAME_MAX" : C.Int.t;
+val SC_TYPED_MEMORY_OBJECTS = _const "Posix_ProcEnv_SC_TYPED_MEMORY_OBJECTS" : C.Int.t;
+val SC_TZNAME_MAX = _const "Posix_ProcEnv_SC_TZNAME_MAX" : C.Int.t;
+val SC_V6_ILP32_OFF32 = _const "Posix_ProcEnv_SC_V6_ILP32_OFF32" : C.Int.t;
+val SC_V6_ILP32_OFFBIG = _const "Posix_ProcEnv_SC_V6_ILP32_OFFBIG" : C.Int.t;
+val SC_V6_LP64_OFF64 = _const "Posix_ProcEnv_SC_V6_LP64_OFF64" : C.Int.t;
+val SC_V6_LPBIG_OFFBIG = _const "Posix_ProcEnv_SC_V6_LPBIG_OFFBIG" : C.Int.t;
+val SC_VERSION = _const "Posix_ProcEnv_SC_VERSION" : C.Int.t;
+val SC_XBS5_ILP32_OFF32 = _const "Posix_ProcEnv_SC_XBS5_ILP32_OFF32" : C.Int.t;
+val SC_XBS5_ILP32_OFFBIG = _const "Posix_ProcEnv_SC_XBS5_ILP32_OFFBIG" : C.Int.t;
+val SC_XBS5_LP64_OFF64 = _const "Posix_ProcEnv_SC_XBS5_LP64_OFF64" : C.Int.t;
+val SC_XBS5_LPBIG_OFFBIG = _const "Posix_ProcEnv_SC_XBS5_LPBIG_OFFBIG" : C.Int.t;
+val SC_XOPEN_CRYPT = _const "Posix_ProcEnv_SC_XOPEN_CRYPT" : C.Int.t;
+val SC_XOPEN_ENH_I18N = _const "Posix_ProcEnv_SC_XOPEN_ENH_I18N" : C.Int.t;
+val SC_XOPEN_LEGACY = _const "Posix_ProcEnv_SC_XOPEN_LEGACY" : C.Int.t;
+val SC_XOPEN_REALTIME = _const "Posix_ProcEnv_SC_XOPEN_REALTIME" : C.Int.t;
+val SC_XOPEN_REALTIME_THREADS = _const "Posix_ProcEnv_SC_XOPEN_REALTIME_THREADS" : C.Int.t;
+val SC_XOPEN_SHM = _const "Posix_ProcEnv_SC_XOPEN_SHM" : C.Int.t;
+val SC_XOPEN_STREAMS = _const "Posix_ProcEnv_SC_XOPEN_STREAMS" : C.Int.t;
+val SC_XOPEN_UNIX = _const "Posix_ProcEnv_SC_XOPEN_UNIX" : C.Int.t;
+val SC_XOPEN_VERSION = _const "Posix_ProcEnv_SC_XOPEN_VERSION" : C.Int.t;
+val setenv = _import "Posix_ProcEnv_setenv" : NullString8.t * NullString8.t -> (C.Int.t) C.Errno.t;
+val setgid = _import "Posix_ProcEnv_setgid" : C.GId.t -> (C.Int.t) C.Errno.t;
+val setgroups = _import "Posix_ProcEnv_setgroups" : C.Int.t * (C.GId.t) vector -> (C.Int.t) C.Errno.t;
+val setpgid = _import "Posix_ProcEnv_setpgid" : C.PId.t * C.PId.t -> (C.Int.t) C.Errno.t;
+val setsid = _import "Posix_ProcEnv_setsid" : unit -> (C.PId.t) C.Errno.t;
+val setuid = _import "Posix_ProcEnv_setuid" : C.UId.t -> (C.Int.t) C.Errno.t;
+val sysconf = _import "Posix_ProcEnv_sysconf" : C.Int.t -> (C.Long.t) C.Errno.t;
+val times = _import "Posix_ProcEnv_times" : unit -> (C.Clock.t) C.Errno.t;
+structure Times = 
+struct
+val getCSTime = _import "Posix_ProcEnv_Times_getCSTime" : unit -> C.Clock.t;
+val getCUTime = _import "Posix_ProcEnv_Times_getCUTime" : unit -> C.Clock.t;
+val getSTime = _import "Posix_ProcEnv_Times_getSTime" : unit -> C.Clock.t;
+val getUTime = _import "Posix_ProcEnv_Times_getUTime" : unit -> C.Clock.t;
+end
+val ttyname = _import "Posix_ProcEnv_ttyname" : C.Fd.t -> (C.String.t) C.Errno.t;
+val uname = _import "Posix_ProcEnv_uname" : unit -> (C.Int.t) C.Errno.t;
+structure Uname = 
+struct
+val getMachine = _import "Posix_ProcEnv_Uname_getMachine" : unit -> C.String.t;
+val getNodeName = _import "Posix_ProcEnv_Uname_getNodeName" : unit -> C.String.t;
+val getRelease = _import "Posix_ProcEnv_Uname_getRelease" : unit -> C.String.t;
+val getSysName = _import "Posix_ProcEnv_Uname_getSysName" : unit -> C.String.t;
+val getVersion = _import "Posix_ProcEnv_Uname_getVersion" : unit -> C.String.t;
+end
+end
+structure Process = 
+struct
+val alarm = _import "Posix_Process_alarm" : C.UInt.t -> C.UInt.t;
+val exece = _import "Posix_Process_exece" : NullString8.t * NullString8Array.t * NullString8Array.t -> (C.Int.t) C.Errno.t;
+val execp = _import "Posix_Process_execp" : NullString8.t * NullString8Array.t -> (C.Int.t) C.Errno.t;
+val exit = _import "Posix_Process_exit" : C.Status.t -> unit;
+val exitStatus = _import "Posix_Process_exitStatus" : C.Status.t -> C.Int.t;
+val fork = _import "Posix_Process_fork" : unit -> (C.PId.t) C.Errno.t;
+val ifExited = _import "Posix_Process_ifExited" : C.Status.t -> Bool.t;
+val ifSignaled = _import "Posix_Process_ifSignaled" : C.Status.t -> Bool.t;
+val ifStopped = _import "Posix_Process_ifStopped" : C.Status.t -> Bool.t;
+val kill = _import "Posix_Process_kill" : C.PId.t * C.Signal.t -> (C.Int.t) C.Errno.t;
+val nanosleep = _import "Posix_Process_nanosleep" : (C.Time.t) ref * (C.Long.t) ref -> (C.Int.t) C.Errno.t;
+val pause = _import "Posix_Process_pause" : unit -> (C.Int.t) C.Errno.t;
+val sleep = _import "Posix_Process_sleep" : C.UInt.t -> C.UInt.t;
+val stopSig = _import "Posix_Process_stopSig" : C.Status.t -> C.Signal.t;
+val system = _import "Posix_Process_system" : NullString8.t -> (C.Status.t) C.Errno.t;
+val termSig = _import "Posix_Process_termSig" : C.Status.t -> C.Signal.t;
+structure W = 
+struct
+val CONTINUED = _const "Posix_Process_W_CONTINUED" : C.Int.t;
+val NOHANG = _const "Posix_Process_W_NOHANG" : C.Int.t;
+val UNTRACED = _const "Posix_Process_W_UNTRACED" : C.Int.t;
+end
+val waitpid = _import "Posix_Process_waitpid" : C.PId.t * (C.Int.t) ref * C.Int.t -> (C.PId.t) C.Errno.t;
+end
+structure Signal = 
+struct
+val default = _import "Posix_Signal_default" : C.Signal.t -> (C.Int.t) C.Errno.t;
+val handlee = _import "Posix_Signal_handlee" : C.Signal.t -> (C.Int.t) C.Errno.t;
+val handleGC = _import "Posix_Signal_handleGC" : unit -> unit;
+val ignore = _import "Posix_Signal_ignore" : C.Signal.t -> (C.Int.t) C.Errno.t;
+val isDefault = _import "Posix_Signal_isDefault" : C.Signal.t * (Bool.t) ref -> (C.Int.t) C.Errno.t;
+val isIgnore = _import "Posix_Signal_isIgnore" : C.Signal.t * (Bool.t) ref -> (C.Int.t) C.Errno.t;
+val isPending = _import "Posix_Signal_isPending" : C.Signal.t -> Bool.t;
+val isPendingGC = _import "Posix_Signal_isPendingGC" : unit -> Bool.t;
+val NSIG = _const "Posix_Signal_NSIG" : C.Int.t;
+val resetPending = _import "Posix_Signal_resetPending" : unit -> unit;
+val SIG_BLOCK = _const "Posix_Signal_SIG_BLOCK" : C.Int.t;
+val SIG_SETMASK = _const "Posix_Signal_SIG_SETMASK" : C.Int.t;
+val SIG_UNBLOCK = _const "Posix_Signal_SIG_UNBLOCK" : C.Int.t;
+val SIGABRT = _const "Posix_Signal_SIGABRT" : C.Signal.t;
+val sigaddset = _import "Posix_Signal_sigaddset" : C.Signal.t -> (C.Int.t) C.Errno.t;
+val SIGALRM = _const "Posix_Signal_SIGALRM" : C.Signal.t;
+val SIGBUS = _const "Posix_Signal_SIGBUS" : C.Signal.t;
+val SIGCHLD = _const "Posix_Signal_SIGCHLD" : C.Signal.t;
+val SIGCONT = _const "Posix_Signal_SIGCONT" : C.Signal.t;
+val sigdelset = _import "Posix_Signal_sigdelset" : C.Signal.t -> (C.Int.t) C.Errno.t;
+val sigemptyset = _import "Posix_Signal_sigemptyset" : unit -> (C.Int.t) C.Errno.t;
+val sigfillset = _import "Posix_Signal_sigfillset" : unit -> (C.Int.t) C.Errno.t;
+val SIGFPE = _const "Posix_Signal_SIGFPE" : C.Signal.t;
+val SIGHUP = _const "Posix_Signal_SIGHUP" : C.Signal.t;
+val SIGILL = _const "Posix_Signal_SIGILL" : C.Signal.t;
+val SIGINT = _const "Posix_Signal_SIGINT" : C.Signal.t;
+val sigismember = _import "Posix_Signal_sigismember" : C.Signal.t -> (C.Int.t) C.Errno.t;
+val SIGKILL = _const "Posix_Signal_SIGKILL" : C.Signal.t;
+val SIGPIPE = _const "Posix_Signal_SIGPIPE" : C.Signal.t;
+val SIGPOLL = _const "Posix_Signal_SIGPOLL" : C.Signal.t;
+val sigprocmask = _import "Posix_Signal_sigprocmask" : C.Int.t -> (C.Int.t) C.Errno.t;
+val SIGPROF = _const "Posix_Signal_SIGPROF" : C.Signal.t;
+val SIGQUIT = _const "Posix_Signal_SIGQUIT" : C.Signal.t;
+val SIGSEGV = _const "Posix_Signal_SIGSEGV" : C.Signal.t;
+val SIGSTOP = _const "Posix_Signal_SIGSTOP" : C.Signal.t;
+val sigsuspend = _import "Posix_Signal_sigsuspend" : unit -> unit;
+val SIGSYS = _const "Posix_Signal_SIGSYS" : C.Signal.t;
+val SIGTERM = _const "Posix_Signal_SIGTERM" : C.Signal.t;
+val SIGTRAP = _const "Posix_Signal_SIGTRAP" : C.Signal.t;
+val SIGTSTP = _const "Posix_Signal_SIGTSTP" : C.Signal.t;
+val SIGTTIN = _const "Posix_Signal_SIGTTIN" : C.Signal.t;
+val SIGTTOU = _const "Posix_Signal_SIGTTOU" : C.Signal.t;
+val SIGURG = _const "Posix_Signal_SIGURG" : C.Signal.t;
+val SIGUSR1 = _const "Posix_Signal_SIGUSR1" : C.Signal.t;
+val SIGUSR2 = _const "Posix_Signal_SIGUSR2" : C.Signal.t;
+val SIGVTALRM = _const "Posix_Signal_SIGVTALRM" : C.Signal.t;
+val SIGXCPU = _const "Posix_Signal_SIGXCPU" : C.Signal.t;
+val SIGXFSZ = _const "Posix_Signal_SIGXFSZ" : C.Signal.t;
+end
+structure SysDB = 
+struct
+val getgrgid = _import "Posix_SysDB_getgrgid" : C.GId.t -> Bool.t;
+val getgrnam = _import "Posix_SysDB_getgrnam" : NullString8.t -> Bool.t;
+val getpwnam = _import "Posix_SysDB_getpwnam" : NullString8.t -> Bool.t;
+val getpwuid = _import "Posix_SysDB_getpwuid" : C.GId.t -> Bool.t;
+structure Group = 
+struct
+val getGId = _import "Posix_SysDB_Group_getGId" : unit -> C.GId.t;
+val getMem = _import "Posix_SysDB_Group_getMem" : unit -> C.StringArray.t;
+val getName = _import "Posix_SysDB_Group_getName" : unit -> C.String.t;
+end
+structure Passwd = 
+struct
+val getDir = _import "Posix_SysDB_Passwd_getDir" : unit -> C.String.t;
+val getGId = _import "Posix_SysDB_Passwd_getGId" : unit -> C.GId.t;
+val getName = _import "Posix_SysDB_Passwd_getName" : unit -> C.String.t;
+val getShell = _import "Posix_SysDB_Passwd_getShell" : unit -> C.String.t;
+val getUId = _import "Posix_SysDB_Passwd_getUId" : unit -> C.UId.t;
+end
+end
+structure TTY = 
+struct
+val B0 = _const "Posix_TTY_B0" : C.Speed.t;
+val B110 = _const "Posix_TTY_B110" : C.Speed.t;
+val B1200 = _const "Posix_TTY_B1200" : C.Speed.t;
+val B134 = _const "Posix_TTY_B134" : C.Speed.t;
+val B150 = _const "Posix_TTY_B150" : C.Speed.t;
+val B1800 = _const "Posix_TTY_B1800" : C.Speed.t;
+val B19200 = _const "Posix_TTY_B19200" : C.Speed.t;
+val B200 = _const "Posix_TTY_B200" : C.Speed.t;
+val B2400 = _const "Posix_TTY_B2400" : C.Speed.t;
+val B300 = _const "Posix_TTY_B300" : C.Speed.t;
+val B38400 = _const "Posix_TTY_B38400" : C.Speed.t;
+val B4800 = _const "Posix_TTY_B4800" : C.Speed.t;
+val B50 = _const "Posix_TTY_B50" : C.Speed.t;
+val B600 = _const "Posix_TTY_B600" : C.Speed.t;
+val B75 = _const "Posix_TTY_B75" : C.Speed.t;
+val B9600 = _const "Posix_TTY_B9600" : C.Speed.t;
+structure CFlags = 
+struct
+val CLOCAL = _const "Posix_TTY_CFlags_CLOCAL" : C.TCFlag.t;
+val CREAD = _const "Posix_TTY_CFlags_CREAD" : C.TCFlag.t;
+val CS5 = _const "Posix_TTY_CFlags_CS5" : C.TCFlag.t;
+val CS6 = _const "Posix_TTY_CFlags_CS6" : C.TCFlag.t;
+val CS7 = _const "Posix_TTY_CFlags_CS7" : C.TCFlag.t;
+val CS8 = _const "Posix_TTY_CFlags_CS8" : C.TCFlag.t;
+val CSIZE = _const "Posix_TTY_CFlags_CSIZE" : C.TCFlag.t;
+val CSTOPB = _const "Posix_TTY_CFlags_CSTOPB" : C.TCFlag.t;
+val HUPCL = _const "Posix_TTY_CFlags_HUPCL" : C.TCFlag.t;
+val PARENB = _const "Posix_TTY_CFlags_PARENB" : C.TCFlag.t;
+val PARODD = _const "Posix_TTY_CFlags_PARODD" : C.TCFlag.t;
+end
+structure IFlags = 
+struct
+val BRKINT = _const "Posix_TTY_IFlags_BRKINT" : C.TCFlag.t;
+val ICRNL = _const "Posix_TTY_IFlags_ICRNL" : C.TCFlag.t;
+val IGNBRK = _const "Posix_TTY_IFlags_IGNBRK" : C.TCFlag.t;
+val IGNCR = _const "Posix_TTY_IFlags_IGNCR" : C.TCFlag.t;
+val IGNPAR = _const "Posix_TTY_IFlags_IGNPAR" : C.TCFlag.t;
+val INLCR = _const "Posix_TTY_IFlags_INLCR" : C.TCFlag.t;
+val INPCK = _const "Posix_TTY_IFlags_INPCK" : C.TCFlag.t;
+val ISTRIP = _const "Posix_TTY_IFlags_ISTRIP" : C.TCFlag.t;
+val IXANY = _const "Posix_TTY_IFlags_IXANY" : C.TCFlag.t;
+val IXOFF = _const "Posix_TTY_IFlags_IXOFF" : C.TCFlag.t;
+val IXON = _const "Posix_TTY_IFlags_IXON" : C.TCFlag.t;
+val PARMRK = _const "Posix_TTY_IFlags_PARMRK" : C.TCFlag.t;
+end
+structure LFlags = 
+struct
+val ECHO = _const "Posix_TTY_LFlags_ECHO" : C.TCFlag.t;
+val ECHOE = _const "Posix_TTY_LFlags_ECHOE" : C.TCFlag.t;
+val ECHOK = _const "Posix_TTY_LFlags_ECHOK" : C.TCFlag.t;
+val ECHONL = _const "Posix_TTY_LFlags_ECHONL" : C.TCFlag.t;
+val ICANON = _const "Posix_TTY_LFlags_ICANON" : C.TCFlag.t;
+val IEXTEN = _const "Posix_TTY_LFlags_IEXTEN" : C.TCFlag.t;
+val ISIG = _const "Posix_TTY_LFlags_ISIG" : C.TCFlag.t;
+val NOFLSH = _const "Posix_TTY_LFlags_NOFLSH" : C.TCFlag.t;
+val TOSTOP = _const "Posix_TTY_LFlags_TOSTOP" : C.TCFlag.t;
+end
+structure OFlags = 
+struct
+val BS0 = _const "Posix_TTY_OFlags_BS0" : C.TCFlag.t;
+val BS1 = _const "Posix_TTY_OFlags_BS1" : C.TCFlag.t;
+val BSDLY = _const "Posix_TTY_OFlags_BSDLY" : C.TCFlag.t;
+val CR0 = _const "Posix_TTY_OFlags_CR0" : C.TCFlag.t;
+val CR1 = _const "Posix_TTY_OFlags_CR1" : C.TCFlag.t;
+val CR2 = _const "Posix_TTY_OFlags_CR2" : C.TCFlag.t;
+val CR3 = _const "Posix_TTY_OFlags_CR3" : C.TCFlag.t;
+val CRDLY = _const "Posix_TTY_OFlags_CRDLY" : C.TCFlag.t;
+val FF0 = _const "Posix_TTY_OFlags_FF0" : C.TCFlag.t;
+val FF1 = _const "Posix_TTY_OFlags_FF1" : C.TCFlag.t;
+val FFDLY = _const "Posix_TTY_OFlags_FFDLY" : C.TCFlag.t;
+val NL0 = _const "Posix_TTY_OFlags_NL0" : C.TCFlag.t;
+val NL1 = _const "Posix_TTY_OFlags_NL1" : C.TCFlag.t;
+val NLDLY = _const "Posix_TTY_OFlags_NLDLY" : C.TCFlag.t;
+val OCRNL = _const "Posix_TTY_OFlags_OCRNL" : C.TCFlag.t;
+val OFILL = _const "Posix_TTY_OFlags_OFILL" : C.TCFlag.t;
+val ONLCR = _const "Posix_TTY_OFlags_ONLCR" : C.TCFlag.t;
+val ONLRET = _const "Posix_TTY_OFlags_ONLRET" : C.TCFlag.t;
+val ONOCR = _const "Posix_TTY_OFlags_ONOCR" : C.TCFlag.t;
+val OPOST = _const "Posix_TTY_OFlags_OPOST" : C.TCFlag.t;
+val TAB0 = _const "Posix_TTY_OFlags_TAB0" : C.TCFlag.t;
+val TAB1 = _const "Posix_TTY_OFlags_TAB1" : C.TCFlag.t;
+val TAB2 = _const "Posix_TTY_OFlags_TAB2" : C.TCFlag.t;
+val TAB3 = _const "Posix_TTY_OFlags_TAB3" : C.TCFlag.t;
+val TABDLY = _const "Posix_TTY_OFlags_TABDLY" : C.TCFlag.t;
+val VT0 = _const "Posix_TTY_OFlags_VT0" : C.TCFlag.t;
+val VT1 = _const "Posix_TTY_OFlags_VT1" : C.TCFlag.t;
+val VTDLY = _const "Posix_TTY_OFlags_VTDLY" : C.TCFlag.t;
+end
+structure TC = 
+struct
+val drain = _import "Posix_TTY_TC_drain" : C.Fd.t -> (C.Int.t) C.Errno.t;
+val flow = _import "Posix_TTY_TC_flow" : C.Fd.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val flush = _import "Posix_TTY_TC_flush" : C.Fd.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val getattr = _import "Posix_TTY_TC_getattr" : C.Fd.t -> (C.Int.t) C.Errno.t;
+val getpgrp = _import "Posix_TTY_TC_getpgrp" : C.Fd.t -> (C.PId.t) C.Errno.t;
+val sendbreak = _import "Posix_TTY_TC_sendbreak" : C.Fd.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val setattr = _import "Posix_TTY_TC_setattr" : C.Fd.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val setpgrp = _import "Posix_TTY_TC_setpgrp" : C.Fd.t * C.PId.t -> (C.Int.t) C.Errno.t;
+val TCIFLUSH = _const "Posix_TTY_TC_TCIFLUSH" : C.Int.t;
+val TCIOFF = _const "Posix_TTY_TC_TCIOFF" : C.Int.t;
+val TCIOFLUSH = _const "Posix_TTY_TC_TCIOFLUSH" : C.Int.t;
+val TCION = _const "Posix_TTY_TC_TCION" : C.Int.t;
+val TCOFLUSH = _const "Posix_TTY_TC_TCOFLUSH" : C.Int.t;
+val TCOOFF = _const "Posix_TTY_TC_TCOOFF" : C.Int.t;
+val TCOON = _const "Posix_TTY_TC_TCOON" : C.Int.t;
+val TCSADRAIN = _const "Posix_TTY_TC_TCSADRAIN" : C.Int.t;
+val TCSAFLUSH = _const "Posix_TTY_TC_TCSAFLUSH" : C.Int.t;
+val TCSANOW = _const "Posix_TTY_TC_TCSANOW" : C.Int.t;
+end
+structure Termios = 
+struct
+val cfGetISpeed = _import "Posix_TTY_Termios_cfGetISpeed" : unit -> C.Speed.t;
+val cfGetOSpeed = _import "Posix_TTY_Termios_cfGetOSpeed" : unit -> C.Speed.t;
+val cfSetISpeed = _import "Posix_TTY_Termios_cfSetISpeed" : C.Speed.t -> (C.Int.t) C.Errno.t;
+val cfSetOSpeed = _import "Posix_TTY_Termios_cfSetOSpeed" : C.Speed.t -> (C.Int.t) C.Errno.t;
+val getCC = _import "Posix_TTY_Termios_getCC" : (C.CC.t) array -> unit;
+val getCFlag = _import "Posix_TTY_Termios_getCFlag" : unit -> C.TCFlag.t;
+val getIFlag = _import "Posix_TTY_Termios_getIFlag" : unit -> C.TCFlag.t;
+val getLFlag = _import "Posix_TTY_Termios_getLFlag" : unit -> C.TCFlag.t;
+val getOFlag = _import "Posix_TTY_Termios_getOFlag" : unit -> C.TCFlag.t;
+val setCC = _import "Posix_TTY_Termios_setCC" : (C.CC.t) array -> unit;
+val setCFlag = _import "Posix_TTY_Termios_setCFlag" : C.TCFlag.t -> unit;
+val setIFlag = _import "Posix_TTY_Termios_setIFlag" : C.TCFlag.t -> unit;
+val setLFlag = _import "Posix_TTY_Termios_setLFlag" : C.TCFlag.t -> unit;
+val setOFlag = _import "Posix_TTY_Termios_setOFlag" : C.TCFlag.t -> unit;
+end
+structure V = 
+struct
+val NCCS = _const "Posix_TTY_V_NCCS" : C.Int.t;
+val VEOF = _const "Posix_TTY_V_VEOF" : C.Int.t;
+val VEOL = _const "Posix_TTY_V_VEOL" : C.Int.t;
+val VERASE = _const "Posix_TTY_V_VERASE" : C.Int.t;
+val VINTR = _const "Posix_TTY_V_VINTR" : C.Int.t;
+val VKILL = _const "Posix_TTY_V_VKILL" : C.Int.t;
+val VMIN = _const "Posix_TTY_V_VMIN" : C.Int.t;
+val VQUIT = _const "Posix_TTY_V_VQUIT" : C.Int.t;
+val VSTART = _const "Posix_TTY_V_VSTART" : C.Int.t;
+val VSTOP = _const "Posix_TTY_V_VSTOP" : C.Int.t;
+val VSUSP = _const "Posix_TTY_V_VSUSP" : C.Int.t;
+val VTIME = _const "Posix_TTY_V_VTIME" : C.Int.t;
+end
+end
+end
+structure Socket = 
+struct
+val accept = _import "Socket_accept" : C.Sock.t * (Word8.t) array * (C.Socklen.t) ref -> (C.Int.t) C.Errno.t;
+structure AF = 
+struct
+val INET = _const "Socket_AF_INET" : C.Int.t;
+val INET6 = _const "Socket_AF_INET6" : C.Int.t;
+val UNIX = _const "Socket_AF_UNIX" : C.Int.t;
+val UNSPEC = _const "Socket_AF_UNSPEC" : C.Int.t;
+end
+val bind = _import "Socket_bind" : C.Sock.t * (Word8.t) vector * C.Socklen.t -> (C.Int.t) C.Errno.t;
+val close = _import "Socket_close" : C.Sock.t -> (C.Int.t) C.Errno.t;
+val connect = _import "Socket_connect" : C.Sock.t * (Word8.t) vector * C.Socklen.t -> (C.Int.t) C.Errno.t;
+structure Ctl = 
+struct
+val FIONBIO = _const "Socket_Ctl_FIONBIO" : C.Int.t;
+val FIONREAD = _const "Socket_Ctl_FIONREAD" : C.Int.t;
+val getIOCtl = _import "Socket_Ctl_getIOCtl" : C.Sock.t * C.Int.t * (Word8.t) array -> (C.Int.t) C.Errno.t;
+val getPeerName = _import "Socket_Ctl_getPeerName" : C.Sock.t * (Word8.t) array * (C.Socklen.t) ref -> (C.Int.t) C.Errno.t;
+val getSockName = _import "Socket_Ctl_getSockName" : C.Sock.t * (Word8.t) array * (C.Socklen.t) ref -> (C.Int.t) C.Errno.t;
+val getSockOpt = _import "Socket_Ctl_getSockOpt" : C.Sock.t * C.Int.t * C.Int.t * (Word8.t) array * (C.Socklen.t) ref -> (C.Int.t) C.Errno.t;
+val setIOCtl = _import "Socket_Ctl_setIOCtl" : C.Sock.t * C.Int.t * (Word8.t) vector -> (C.Int.t) C.Errno.t;
+val setSockOpt = _import "Socket_Ctl_setSockOpt" : C.Sock.t * C.Int.t * C.Int.t * (Word8.t) vector * C.Socklen.t -> (C.Int.t) C.Errno.t;
+val SIOCATMARK = _const "Socket_Ctl_SIOCATMARK" : C.Int.t;
+val SO_ACCEPTCONN = _const "Socket_Ctl_SO_ACCEPTCONN" : C.Int.t;
+val SO_BROADCAST = _const "Socket_Ctl_SO_BROADCAST" : C.Int.t;
+val SO_DEBUG = _const "Socket_Ctl_SO_DEBUG" : C.Int.t;
+val SO_DONTROUTE = _const "Socket_Ctl_SO_DONTROUTE" : C.Int.t;
+val SO_ERROR = _const "Socket_Ctl_SO_ERROR" : C.Int.t;
+val SO_KEEPALIVE = _const "Socket_Ctl_SO_KEEPALIVE" : C.Int.t;
+val SO_LINGER = _const "Socket_Ctl_SO_LINGER" : C.Int.t;
+val SO_OOBINLINE = _const "Socket_Ctl_SO_OOBINLINE" : C.Int.t;
+val SO_RCVBUF = _const "Socket_Ctl_SO_RCVBUF" : C.Int.t;
+val SO_RCVLOWAT = _const "Socket_Ctl_SO_RCVLOWAT" : C.Int.t;
+val SO_RCVTIMEO = _const "Socket_Ctl_SO_RCVTIMEO" : C.Int.t;
+val SO_REUSEADDR = _const "Socket_Ctl_SO_REUSEADDR" : C.Int.t;
+val SO_SNDBUF = _const "Socket_Ctl_SO_SNDBUF" : C.Int.t;
+val SO_SNDLOWAT = _const "Socket_Ctl_SO_SNDLOWAT" : C.Int.t;
+val SO_SNDTIMEO = _const "Socket_Ctl_SO_SNDTIMEO" : C.Int.t;
+val SO_TYPE = _const "Socket_Ctl_SO_TYPE" : C.Int.t;
+val SOL_SOCKET = _const "Socket_Ctl_SOL_SOCKET" : C.Int.t;
+end
+val familyOfAddr = _import "Socket_familyOfAddr" : (Word8.t) vector -> C.Int.t;
+structure GenericSock = 
+struct
+val socket = _import "Socket_GenericSock_socket" : C.Int.t * C.Int.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val socketPair = _import "Socket_GenericSock_socketPair" : C.Int.t * C.Int.t * C.Int.t * (C.Int.t) array -> (C.Int.t) C.Errno.t;
+end
+structure INetSock = 
+struct
+structure Ctl = 
+struct
+val IPPROTO_TCP = _const "Socket_INetSock_Ctl_IPPROTO_TCP" : C.Int.t;
+val TCP_NODELAY = _const "Socket_INetSock_Ctl_TCP_NODELAY" : C.Int.t;
+end
+val fromAddr = _import "Socket_INetSock_fromAddr" : (Word8.t) vector -> unit;
+val getInAddr = _import "Socket_INetSock_getInAddr" : (Word8.t) array -> unit;
+val getPort = _import "Socket_INetSock_getPort" : unit -> C.Int.t;
+val toAddr = _import "Socket_INetSock_toAddr" : (Word8.t) vector * C.Int.t * (Word8.t) array * (C.Socklen.t) ref -> unit;
+end
+val listen = _import "Socket_listen" : C.Sock.t * C.Int.t -> (C.Int.t) C.Errno.t;
+val MSG_CTRUNC = _const "Socket_MSG_CTRUNC" : C.Int.t;
+val MSG_DONTROUTE = _const "Socket_MSG_DONTROUTE" : C.Int.t;
+val MSG_DONTWAIT = _const "Socket_MSG_DONTWAIT" : C.Int.t;
+val MSG_EOR = _const "Socket_MSG_EOR" : C.Int.t;
+val MSG_OOB = _const "Socket_MSG_OOB" : C.Int.t;
+val MSG_PEEK = _const "Socket_MSG_PEEK" : C.Int.t;
+val MSG_TRUNC = _const "Socket_MSG_TRUNC" : C.Int.t;
+val MSG_WAITALL = _const "Socket_MSG_WAITALL" : C.Int.t;
+val recv = _import "Socket_recv" : C.Sock.t * (Word8.t) array * C.Int.t * C.Size.t * C.Int.t -> (C.SSize.t) C.Errno.t;
+val recvFrom = _import "Socket_recvFrom" : C.Sock.t * (Word8.t) array * C.Int.t * C.Size.t * C.Int.t * (Word8.t) array * (C.Socklen.t) ref -> (C.SSize.t) C.Errno.t;
+val sendArr = _import "Socket_sendArr" : C.Sock.t * (Word8.t) array * C.Int.t * C.Size.t * C.Int.t -> (C.SSize.t) C.Errno.t;
+val sendArrTo = _import "Socket_sendArrTo" : C.Sock.t * (Word8.t) array * C.Int.t * C.Size.t * C.Int.t * (Word8.t) vector * C.Socklen.t -> (C.SSize.t) C.Errno.t;
+val sendVec = _import "Socket_sendVec" : C.Sock.t * (Word8.t) vector * C.Int.t * C.Size.t * C.Int.t -> (C.SSize.t) C.Errno.t;
+val sendVecTo = _import "Socket_sendVecTo" : C.Sock.t * (Word8.t) vector * C.Int.t * C.Size.t * C.Int.t * (Word8.t) vector * C.Socklen.t -> (C.SSize.t) C.Errno.t;
+val SHUT_RD = _const "Socket_SHUT_RD" : C.Int.t;
+val SHUT_RDWR = _const "Socket_SHUT_RDWR" : C.Int.t;
+val SHUT_WR = _const "Socket_SHUT_WR" : C.Int.t;
+val shutdown = _import "Socket_shutdown" : C.Sock.t * C.Int.t -> (C.Int.t) C.Errno.t;
+structure SOCK = 
+struct
+val DGRAM = _const "Socket_SOCK_DGRAM" : C.Int.t;
+val RAW = _const "Socket_SOCK_RAW" : C.Int.t;
+val SEQPACKET = _const "Socket_SOCK_SEQPACKET" : C.Int.t;
+val STREAM = _const "Socket_SOCK_STREAM" : C.Int.t;
+end
+val sockAddrStorageLen = _const "Socket_sockAddrStorageLen" : C.Size.t;
+structure UnixSock = 
+struct
+val fromAddr = _import "Socket_UnixSock_fromAddr" : (Word8.t) vector * (Char8.t) array * C.Size.t -> unit;
+val pathLen = _import "Socket_UnixSock_pathLen" : (Word8.t) vector -> C.Size.t;
+val toAddr = _import "Socket_UnixSock_toAddr" : NullString8.t * C.Size.t * (Word8.t) array * (C.Socklen.t) ref -> unit;
+end
+end
+structure Stdio = 
+struct
+val print = _import "Stdio_print" : String8.t -> unit;
+end
+structure Time = 
+struct
+val getTimeOfDay = _import "Time_getTimeOfDay" : unit -> C.Int.t;
+val sec = _import "Time_sec" : unit -> C.Time.t;
+val usec = _import "Time_usec" : unit -> C.SUSeconds.t;
+end
+structure Windows = 
+struct
+structure Process = 
+struct
+val create = _import "Windows_Process_create" : NullString8.t * NullString8.t * NullString8.t * C.Fd.t * C.Fd.t * C.Fd.t -> (C.PId.t) C.Errno.t;
+val terminate = _import "Windows_Process_terminate" : C.PId.t * C.Signal.t -> (C.Int.t) C.Errno.t;
+end
+end
+end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.mlb	2006-01-30 00:44:07 UTC (rev 4330)
@@ -14,7 +14,7 @@
    "nonexhaustiveMatch warn"
    "redundantMatch warn"
    "sequenceNonUnit warn"
-   "warnUnused true"
+   "warnUnused false"
 in
    prim-basis.mlb
    ann "forceUsed" in

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.sml	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/primitive/primitive.sml	2006-01-30 00:44:07 UTC (rev 4330)
@@ -16,7 +16,6 @@
 type char = Char.char
 structure Int = Int32
 type int = Int.int
-structure Position = Int64
 structure Real = Real64
 type real = Real.real
 
@@ -815,41 +814,6 @@
                      end
                end
 
-            structure Process =
-               struct
-                  val spawne =
-                     if let
-                           open Platform.OS
-                        in
-                           case host of
-                              Cygwin => true
-                            | MinGW => true
-                            | _ => false
-                        end
-                        then
-                           _import "MLton_Process_spawne"
-                           : (NullString.t 
-                              * NullString.t array
-                              * NullString.t array
-                              -> Pid.t);
-                        else fn _ => raise Fail "spawne not defined"
-                  val spawnp =
-                     if let
-                           open Platform.OS
-                        in
-                           case host of
-                              Cygwin => true
-                            | MinGW => true
-                            | _ => false
-                        end
-                        then
-                           _import "MLton_Process_spawnp"
-                           : (NullString.t 
-                              * NullString.t array
-                              -> Pid.t);
-                        else fn _ => raise Fail "spawnp not defined"
-               end
-            
             structure Profile =
                struct
                   val isOn = _build_const "MLton_Profile_isOn": bool;
@@ -884,13 +848,6 @@
                end
          end
 
-      structure NetHostDB =
-         struct
-            (* network byte order (MSB) *)
-            type pre_in_addr = Word8.word array
-            type in_addr = Word8.word vector
-         end
-
       structure PackReal32 =
          struct
             type real = Real32.real
@@ -1131,194 +1088,6 @@
             val assign = _prim "Ref_assign": 'a ref * 'a -> unit;
          end
 
-      structure Signal:
-         sig
-            eqtype t
-
-            val fromInt: int -> t
-            val toInt: t -> int
-         end =
-         struct
-            type t = int
-
-            val fromInt = fn s => s
-            val toInt = fn s => s
-         end
-
-      structure Socket:
-         sig
-            type sock
-
-            val fromInt: int -> sock
-            val toInt: sock -> int
-         end =
-         struct
-            type sock = int
-
-            fun fromInt i = i
-            fun toInt i = i
-         end
-            
-      structure Socket =
-         struct
-            open Socket
-
-            type pre_sock_addr = Word8.word array
-            type sock_addr = Word8.word vector
-            val sockAddrLenMax = _const "Socket_sockAddrLenMax": int;
-            structure AF =
-               struct
-                  type addr_family = int
-                  val UNIX = _const "Socket_AF_UNIX": addr_family;
-                  val INET = _const "Socket_AF_INET": addr_family;
-                  val INET6 = _const "Socket_AF_INET6": addr_family;
-                  val UNSPEC = _const "Socket_AF_UNSPEC": addr_family;
-               end
-            structure SOCK:
-               sig
-                  eqtype sock_type
-
-                  val fromInt: int -> sock_type
-               end =
-               struct
-                  type sock_type = int
-
-                  val fromInt = fn i => i
-               end
-            structure SOCK =
-               struct
-                  open SOCK
-                  val STREAM = _const "Socket_SOCK_STREAM": sock_type;
-                  val DGRAM = _const "Socket_SOCK_DGRAM": sock_type;
-               end
-            structure CtlExtra =
-               struct
-                  type level = int
-                  type optname = int
-                  type request = int
-                  (* host byte order (LSB) *)
-                  type read_data = Word8.word vector
-                  type write_data = Word8.word array
-
-                  val setSockOpt = 
-                     _import "Socket_Ctl_setSockOpt": sock * level * optname * 
-                                                   read_data * int -> 
-                                                   int;
-                  val getSockOpt = 
-                     _import "Socket_Ctl_getSockOpt": sock * level * optname * 
-                                                   write_data * int ref -> 
-                                                   int;
-                  val setIOCtl =
-                     _import "Socket_Ctl_getsetIOCtl": sock * request *
-                                                    read_data ->
-                                                    int;
-                  val getIOCtl =
-                     _import "Socket_Ctl_getsetIOCtl": sock * request *
-                                                    write_data ->
-                                                    int;
-               end
-            structure Ctl =
-               struct
-                  open CtlExtra
-                  val SOCKET = _const "Socket_Ctl_SOL_SOCKET": level;
-                  val DEBUG = _const "Socket_Ctl_SO_DEBUG": optname;
-                  val REUSEADDR = _const "Socket_Ctl_SO_REUSEADDR": optname;
-                  val KEEPALIVE = _const "Socket_Ctl_SO_KEEPALIVE": optname;
-                  val DONTROUTE = _const "Socket_Ctl_SO_DONTROUTE": optname;
-                  val LINGER = _const "Socket_Ctl_SO_LINGER": optname;
-                  val BROADCAST = _const "Socket_Ctl_SO_BROADCAST": optname;
-                  val OOBINLINE = _const "Socket_Ctl_SO_OOBINLINE": optname;
-                  val SNDBUF = _const "Socket_Ctl_SO_SNDBUF": optname;
-                  val RCVBUF = _const "Socket_Ctl_SO_RCVBUF": optname;
-                  val TYPE = _const "Socket_Ctl_SO_TYPE": optname;
-                  val ERROR = _const "Socket_Ctl_SO_ERROR": optname;
-
-                  val getPeerName =
-                     _import "Socket_Ctl_getPeerName": sock * pre_sock_addr * int ref -> int;
-                  val getSockName =
-                     _import "Socket_Ctl_getSockName": sock * pre_sock_addr * int ref -> int;
-
-                  (* val NBIO = _const "Socket_Ctl_FIONBIO": request; *)
-                  val NREAD = _const "Socket_Ctl_FIONREAD": request;
-                  val ATMARK = _const "Socket_Ctl_SIOCATMARK": request;
-               end
-
-            val familyOfAddr =
-               _import "Socket_familyOfAddr": sock_addr -> AF.addr_family;
-            val bind = _import "Socket_bind": sock * sock_addr * int -> int;
-            val listen = _import "Socket_listen": sock * int -> int;
-            val connect =
-               _import "Socket_connect": sock * sock_addr * int -> int;
-            val accept =
-               _import "Socket_accept": sock * pre_sock_addr * int ref -> int;
-            val close = _import "Socket_close": sock -> int;
-
-            type how = int
-            val SHUT_RD = _const "Socket_SHUT_RD": how;
-            val SHUT_WR = _const "Socket_SHUT_WR": how;
-            val SHUT_RDWR = _const "Socket_SHUT_RDWR": how;
-            val shutdown = _import "Socket_shutdown": sock * how -> int;
-
-            type flags = word
-            val MSG_DONTROUTE = _const "Socket_MSG_DONTROUTE": flags;
-            val MSG_DONTWAIT = _const "Socket_MSG_DONTWAIT": flags;
-            val MSG_OOB = _const "Socket_MSG_OOB": flags;
-            val MSG_PEEK = _const "Socket_MSG_PEEK": flags;
-
-            val sendArr = _import "Socket_send":
-               sock * Word8.word array * int * int * word -> int;
-            val sendVec = _import "Socket_send":
-               sock * Word8.word vector * int * int * word -> int;
-            val sendToArr = _import "Socket_sendTo":
-               sock * Word8.word array * int * int * word * sock_addr * int -> int;
-            val sendToVec = _import "Socket_sendTo":
-               sock * Word8.word vector * int * int * word * sock_addr * int -> int;
-            val recv = _import "Socket_recv":
-               sock * Word8.word array * int * int * word -> int;
-            val recvFrom = _import "Socket_recvFrom":
-               sock * Word8.word array * int * int * word * pre_sock_addr * int ref
-               -> int;
-
-            structure GenericSock =
-               struct
-                  val socket = 
-                     _import "GenericSock_socket": AF.addr_family * 
-                                                SOCK.sock_type * 
-                                                int -> int;
-                  val socketPair = 
-                     _import "GenericSock_socketPair": AF.addr_family * 
-                                                    SOCK.sock_type * 
-                                                    int * 
-                                                    int ref * int ref -> int;
-               end
-
-            structure INetSock =
-               struct
-                  val toAddr = _import "INetSock_toAddr": NetHostDB.in_addr * int * 
-                                                       pre_sock_addr * int ref -> unit;
-                  val fromAddr = _import "INetSock_fromAddr": sock_addr -> unit;
-                  val getInAddr = _import "INetSock_getInAddr": NetHostDB.pre_in_addr -> 
-                                                             unit;
-                  val getPort = _import "INetSock_getPort": unit -> int;
-                  structure TCP =
-                     struct
-                        open CtlExtra
-                        val TCP = _const "Socket_INetSock_TCP_SOL_TCP": level;
-                        val NODELAY = _const "Socket_INetSock_TCP_SO_NODELAY": optname;
-                     end
-               end
-            structure UnixSock =
-               struct
-                  val toAddr =
-                     _import "UnixSock_toAddr"
-                     : NullString.t * int * pre_sock_addr * int ref -> unit;
-                  val pathLen = _import "UnixSock_pathLen": sock_addr -> int;
-                  val fromAddr =
-                     _import "UnixSock_fromAddr"
-                     : sock_addr * char array * int -> unit;
-               end
-         end
-
       structure Status:
          sig
             eqtype t
@@ -1840,19 +1609,6 @@
             val toWord = Word32.fromInt
          end
 
-      structure Windows =
-         struct
-            structure Process =
-               struct
-                  val create = 
-                     _import "Windows_Process_create"
-                     : (NullString.t * NullString.t * NullString.t
-                        * FileDesc.t * FileDesc.t * FileDesc.t) -> Pid.t;
-                  val terminate =
-                     _import "Windows_terminate": Pid.t * Signal.t -> int;
-               end
-         end
-
       structure World =
          struct
             val getAmOriginal = _import "GC_getAmOriginal": GCState.t -> bool;

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/backend/pointer-tycon.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/backend/pointer-tycon.fun	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/backend/pointer-tycon.fun	2006-01-30 00:44:07 UTC (rev 4330)
@@ -49,12 +49,14 @@
    val word8Vector = new ()
    val word16Vector = new ()
    val word32Vector = new ()
+   val word64Vector = new ()
 in
    fun wordVector (b: Bits.t): t =
       case Bits.toInt b of
          8 => word8Vector
        | 16 => word16Vector
        | 32 => word32Vector
+       | 64 => word64Vector
        | _ => Error.bug "PointerTycon.wordVector"
 end
 

Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun	2006-01-30 00:44:07 UTC (rev 4330)
@@ -379,7 +379,7 @@
    let
       val _ = amBuildingConstants := true
       val (_, decs) =
-         parseAndElaborateMLB (MLBString.fromFile "$(SML_LIB)/basis/libs/primitive.mlb")
+         parseAndElaborateMLB (MLBString.fromFile "$(SML_LIB)/basis/primitive/primitive.mlb")
       val decs = Vector.concatV (Vector.map (decs, Vector.fromList o #1))
       (* Need to defunctorize so the constants are forced. *)
       val _ = Defunctorize.defunctorize (CoreML.Program.T {decs = decs})

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/IO/FLock-consts.c	2006-01-30 00:44:07 UTC (rev 4330)
@@ -4,10 +4,10 @@
 const C_Int_t Posix_IO_FLock_F_SETLK = F_SETLK;
 const C_Int_t Posix_IO_FLock_F_SETLKW = F_SETLKW;
 
-const C_Short_t Posix_IO_Flock_F_RDLCK = F_RDLCK;
-const C_Short_t Posix_IO_Flock_F_UNLCK = F_UNLCK;
-const C_Short_t Posix_IO_Flock_F_WRLCK = F_WRLCK;
+const C_Short_t Posix_IO_FLock_F_RDLCK = F_RDLCK;
+const C_Short_t Posix_IO_FLock_F_UNLCK = F_UNLCK;
+const C_Short_t Posix_IO_FLock_F_WRLCK = F_WRLCK;
 
-const C_Short_t Posix_IO_Flock_SEEK_CUR = SEEK_CUR;
-const C_Short_t Posix_IO_Flock_SEEK_END = SEEK_END;
-const C_Short_t Posix_IO_Flock_SEEK_SET = SEEK_SET;
+const C_Short_t Posix_IO_FLock_SEEK_CUR = SEEK_CUR;
+const C_Short_t Posix_IO_FLock_SEEK_END = SEEK_END;
+const C_Short_t Posix_IO_FLock_SEEK_SET = SEEK_SET;

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal-consts.c	2006-01-30 00:44:07 UTC (rev 4330)
@@ -1,9 +1,9 @@
 #include "platform.h"
 
 #if (defined (NSIG))
-#define Posix_Signal_NSIG NSIG
+const C_Int_t Posix_Signal_NSIG = NSIG;
 #elif (defined (_NSIG))
-#define Posix_Signal_NSIG _NSIG
+const C_Int_t Posix_Signal_NSIG = _NSIG;
 #else
 #error Posix_Signal_numSignals not defined
 #endif

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/Socket-consts.c	2006-01-30 00:44:07 UTC (rev 4330)
@@ -37,3 +37,7 @@
 const C_Int_t Socket_SOCK_RAW = SOCK_RAW;
 const C_Int_t Socket_SOCK_SEQPACKET = SOCK_SEQPACKET;
 const C_Int_t Socket_SOCK_STREAM = SOCK_STREAM;
+const C_Int_t Socket_Ctl_FIONBIO = FIONBIO;
+const C_Int_t Socket_Ctl_FIONREAD = FIONREAD;
+const C_Int_t Socket_Ctl_SIOCATMARK = SIOCATMARK;
+

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c	2006-01-30 00:44:07 UTC (rev 4330)
@@ -21,7 +21,7 @@
   *((socklen_t*)addrlen) = sizeof(struct sockaddr_un);
 }
 
-C_Size_t Socket_UnixSock_pathLen (Array(Word8_t) addr) {
+C_Size_t Socket_UnixSock_pathLen (Vector(Word8_t) addr) {
   size_t i;
   struct sockaddr_un *sa = (struct sockaddr_un*)addr;
 
@@ -34,7 +34,7 @@
   }
 }
 
-void Socket_UnixSock_fromAddr (Array(Word8_t) addr, Array(Char8_t) path, C_Size_t pathlen) {
+void Socket_UnixSock_fromAddr (Vector(Word8_t) addr, Array(Char8_t) path, C_Size_t pathlen) {
   size_t i;
   struct sockaddr_un *sa = (struct sockaddr_un*)addr;
   

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def	2006-01-29 21:18:38 UTC (rev 4329)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/basis-ffi.def	2006-01-30 00:44:07 UTC (rev 4330)
@@ -735,9 +735,9 @@
 Socket.AF.INET6 = _const : C.Int.t
 Socket.AF.UNIX = _const : C.Int.t
 Socket.AF.UNSPEC = _const : C.Int.t
-Socket.Clt.FIONBIO = _const : C.Int.t
-Socket.Clt.FIONREAD = _const : C.Int.t
-Socket.Clt.SIOCATMARK = _const : C.Int.t
+Socket.Ctl.FIONBIO = _const : C.Int.t
+Socket.Ctl.FIONREAD = _const : C.Int.t
+Socket.Ctl.SIOCATMARK = _const : C.Int.t
 Socket.Ctl.SOL_SOCKET = _const : C.Int.t
 Socket.Ctl.SO_ACCEPTCONN = _const : C.Int.t
 Socket.Ctl.SO_BROADCAST = _const : C.Int.t
@@ -769,15 +769,26 @@
 Socket.INetSock.getInAddr = _import : Word8.t array -> unit
 Socket.INetSock.getPort = _import : unit -> C.Int.t
 Socket.INetSock.toAddr = _import : Word8.t vector * C.Int.t * Word8.t array * C.Socklen.t ref -> unit
+Socket.MSG_CTRUNC = _const : C.Int.t
+Socket.MSG_DONTROUTE = _const : C.Int.t
+Socket.MSG_DONTWAIT = _const : C.Int.t
+Socket.MSG_EOR = _const : C.Int.t
+Socket.MSG_OOB = _const : C.Int.t
+Socket.MSG_PEEK = _const : C.Int.t
+Socket.MSG_TRUNC = _const : C.Int.t
+Socket.MSG_WAITALL = _const : C.Int.t
+Socket.SHUT_RD = _const : C.Int.t
+Socket.SHUT_RDWR = _const : C.Int.t
+Socket.SHUT_WR = _const : C.Int.t
 Socket.SOCK.DGRAM = _const : C.Int.t
 Socket.SOCK.RAW = _const : C.Int.t
 Socket.SOCK.SEQPACKET = _const : C.Int.t
 Socket.SOCK.STREAM = _const : C.Int.t
-Socket.UnixSock.fromAddr = _import : Word8.t array * Char8.t array * C.Size.t -> unit
-Socket.UnixSock.pathLen = _import : Word8.t array -> C.Size.t
+Socket.UnixSock.fromAddr = _import : Word8.t vector * Char8.t array * C.Size.t -> unit
+Socket.UnixSock.pathLen = _import : Word8.t vector -> C.Size.t
 Socket.UnixSock.toAddr = _import : NullString8.t * C.Size.t * Word8.t array * C.Socklen.t ref -> unit
 Socket.accept = _import : C.Sock.t * Word8.t array * C.Socklen.t ref -> C.Int.t C.Errno.t
-Socket.bind = _import : C.Sock.t * Word8.t array * C.Socklen.t -> C.Int.t C.Errno.t
+Socket.bind = _import : C.Sock.t * Word8.t vector * C.Socklen.t -> C.Int.t C.Errno.t
 Socket.close = _import : C.Sock.t -> C.Int.t C.Errno.t
 Socket.connect = _import : C.Sock.t * Word8.t vector * C.Socklen.t -> C.Int.t C.Errno.t
 Socket.familyOfAddr = _import : Word8.t vector -> C.Int.t