Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 2002-2006 Henry Cejtin, Matthew Fluet, Suresh |
2 | * Jagannathan, and Stephen Weeks. | |
3 | * | |
4 | * MLton is released under a BSD-style license. | |
5 | * See the file MLton-LICENSE for details. | |
6 | *) | |
7 | ||
8 | functor PosixIOConvert (structure IO: POSIX_IO): POSIX_IO_1997 = | |
9 | struct | |
10 | open IO | |
11 | ||
12 | structure FD = | |
13 | struct | |
14 | open FD | |
15 | structure Flags = FlagsConvert (structure Flags = FD) | |
16 | open Flags | |
17 | end | |
18 | ||
19 | structure O = | |
20 | struct | |
21 | open O | |
22 | structure Flags = FlagsConvert (structure Flags = O) | |
23 | open Flags | |
24 | end | |
25 | ||
26 | fun readArr (fd, {buf, i, sz}) = | |
27 | IO.readArr (fd, Word8ArraySlice.slice (buf, i, sz)) | |
28 | ||
29 | fun writeArr (fd, {buf, i, sz}) = | |
30 | IO.writeArr (fd, Word8ArraySlice.slice (buf, i, sz)) | |
31 | ||
32 | fun writeVec (fd, {buf, i, sz}) = | |
33 | IO.writeVec (fd, Word8VectorSlice.slice (buf, i, sz)) | |
34 | end |