|
21 | 21 | (param $len $filesize)
|
22 | 22 | ;;; The advice.
|
23 | 23 | (param $advice $advice)
|
24 |
| - (result $error $errno) |
| 24 | + (result $error (expected (error $errno))) |
25 | 25 | )
|
26 | 26 |
|
27 | 27 | ;;; Force the allocation of space in a file.
|
|
32 | 32 | (param $offset $filesize)
|
33 | 33 | ;;; The length of the area that is allocated.
|
34 | 34 | (param $len $filesize)
|
35 |
| - (result $error $errno) |
| 35 | + (result $error (expected (error $errno))) |
36 | 36 | )
|
37 | 37 |
|
38 | 38 | ;;; Close a file descriptor.
|
39 | 39 | ;;; Note: This is similar to `close` in POSIX.
|
40 | 40 | (@interface func (export "close")
|
41 | 41 | (param $fd $fd)
|
42 |
| - (result $error $errno) |
| 42 | + (result $error (expected (error $errno))) |
43 | 43 | )
|
44 | 44 |
|
45 | 45 | ;;; Synchronize the data of a file to disk.
|
46 | 46 | ;;; Note: This is similar to `fdatasync` in POSIX.
|
47 | 47 | (@interface func (export "datasync")
|
48 | 48 | (param $fd $fd)
|
49 |
| - (result $error $errno) |
| 49 | + (result $error (expected (error $errno))) |
50 | 50 | )
|
51 | 51 |
|
52 | 52 | ;;; Get the attributes of a file descriptor.
|
53 | 53 | ;;; Note: This returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as well as additional fields.
|
54 | 54 | (@interface func (export "fdstat_get")
|
55 | 55 | (param $fd $fd)
|
56 |
| - (result $error $errno) |
57 | 56 | ;;; The buffer where the file descriptor's attributes are stored.
|
58 |
| - (result $stat $fdstat) |
| 57 | + (result $error (expected $fdstat (error $errno))) |
59 | 58 | )
|
60 | 59 |
|
61 | 60 | ;;; Adjust the flags associated with a file descriptor.
|
|
64 | 63 | (param $fd $fd)
|
65 | 64 | ;;; The desired values of the file descriptor flags.
|
66 | 65 | (param $flags $fdflags)
|
67 |
| - (result $error $errno) |
| 66 | + (result $error (expected (error $errno))) |
68 | 67 | )
|
69 | 68 |
|
70 | 69 | ;;; Adjust the rights associated with a file descriptor.
|
|
74 | 73 | ;;; The desired rights of the file descriptor.
|
75 | 74 | (param $fs_rights_base $rights)
|
76 | 75 | (param $fs_rights_inheriting $rights)
|
77 |
| - (result $error $errno) |
| 76 | + (result $error (expected (error $errno))) |
78 | 77 | )
|
79 | 78 |
|
80 | 79 | ;;; Return the attributes of an open file.
|
81 | 80 | (@interface func (export "filestat_get")
|
82 | 81 | (param $fd $fd)
|
83 |
| - (result $error $errno) |
84 | 82 | ;;; The buffer where the file's attributes are stored.
|
85 |
| - (result $buf $filestat) |
| 83 | + (result $error (expected $filestat (error $errno))) |
86 | 84 | )
|
87 | 85 |
|
88 | 86 | ;;; Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
|
|
91 | 89 | (param $fd $fd)
|
92 | 90 | ;;; The desired file size.
|
93 | 91 | (param $size $filesize)
|
94 |
| - (result $error $errno) |
| 92 | + (result $error (expected (error $errno))) |
95 | 93 | )
|
96 | 94 |
|
97 | 95 | ;;; Adjust the timestamps of an open file or directory.
|
|
104 | 102 | (param $mtim $timestamp)
|
105 | 103 | ;;; A bitmask indicating which timestamps to adjust.
|
106 | 104 | (param $fst_flags $fstflags)
|
107 |
| - (result $error $errno) |
| 105 | + (result $error (expected (error $errno))) |
108 | 106 | )
|
109 | 107 |
|
110 | 108 | ;;; Set the permissions of a file or directory.
|
|
123 | 121 | (param $fd $fd)
|
124 | 122 | ;;; The permissions associated with the file.
|
125 | 123 | (param $permissions $permissions)
|
126 |
| - (result $error $errno) |
| 124 | + (result $error (expected (error $errno))) |
127 | 125 | )
|
128 | 126 |
|
129 | 127 | ;;; Read from a file descriptor, without using and updating the file descriptor's offset.
|
|
134 | 132 | (param $iovs $iovec_array)
|
135 | 133 | ;;; The offset within the file at which to read.
|
136 | 134 | (param $offset $filesize)
|
137 |
| - (result $error $errno) |
138 | 135 | ;;; The number of bytes read.
|
139 |
| - (result $nread $size) |
| 136 | + (result $error (expected $size (error $errno))) |
140 | 137 | )
|
141 | 138 |
|
142 | 139 | ;;; Return a description of the given preopened file descriptor.
|
143 | 140 | (@interface func (export "prestat_get")
|
144 | 141 | (param $fd $fd)
|
145 |
| - (result $error $errno) |
146 | 142 | ;;; The buffer where the description is stored.
|
147 |
| - (result $buf $prestat) |
| 143 | + (result $error (expected $prestat (error $errno))) |
148 | 144 | )
|
149 | 145 |
|
150 | 146 | ;;; Return a description of the given preopened file descriptor.
|
|
153 | 149 | ;;; A buffer into which to write the preopened directory name.
|
154 | 150 | (param $path (@witx pointer (@witx char8)))
|
155 | 151 | (param $path_len $size)
|
156 |
| - (result $error $errno) |
| 152 | + (result $error (expected (error $errno))) |
157 | 153 | )
|
158 | 154 |
|
159 | 155 | ;;; Write to a file descriptor, without using and updating the file descriptor's offset.
|
|
168 | 164 | (param $iovs $ciovec_array)
|
169 | 165 | ;;; The offset within the file at which to write.
|
170 | 166 | (param $offset $filesize)
|
171 |
| - (result $error $errno) |
172 | 167 | ;;; The number of bytes written.
|
173 |
| - (result $nwritten $size) |
| 168 | + (result $error (expected $size (error $errno))) |
174 | 169 | )
|
175 | 170 |
|
176 | 171 | ;;; Read from a file descriptor.
|
|
179 | 174 | (param $fd $fd)
|
180 | 175 | ;;; List of scatter/gather vectors to which to store data.
|
181 | 176 | (param $iovs $iovec_array)
|
182 |
| - (result $error $errno) |
183 | 177 | ;;; The number of bytes read.
|
184 |
| - (result $nread $size) |
| 178 | + (result $error (expected $size (error $errno))) |
185 | 179 | )
|
186 | 180 |
|
187 | 181 | ;;; Read directory entries from a directory.
|
|
201 | 195 | (param $buf_len $size)
|
202 | 196 | ;;; The location within the directory to start reading
|
203 | 197 | (param $cookie $dircookie)
|
204 |
| - (result $error $errno) |
205 | 198 | ;;; The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.
|
206 |
| - (result $bufused $size) |
| 199 | + (result $error (expected $size (error $errno))) |
207 | 200 | )
|
208 | 201 |
|
209 | 202 | ;;; Atomically replace a file descriptor by renumbering another file descriptor.
|
|
220 | 213 | (param $fd $fd)
|
221 | 214 | ;;; The file descriptor to overwrite.
|
222 | 215 | (param $to $fd)
|
223 |
| - (result $error $errno) |
| 216 | + (result $error (expected (error $errno))) |
224 | 217 | )
|
225 | 218 |
|
226 | 219 | ;;; Move the offset of a file descriptor.
|
|
231 | 224 | (param $offset $filedelta)
|
232 | 225 | ;;; The base from which the offset is relative.
|
233 | 226 | (param $whence $whence)
|
234 |
| - (result $error $errno) |
235 | 227 | ;;; The new offset of the file descriptor, relative to the start of the file.
|
236 |
| - (result $newoffset $filesize) |
| 228 | + (result $error (expected $filesize (error $errno))) |
237 | 229 | )
|
238 | 230 |
|
239 | 231 | ;;; Synchronize the data and metadata of a file to disk.
|
240 | 232 | ;;; Note: This is similar to `fsync` in POSIX.
|
241 | 233 | (@interface func (export "sync")
|
242 | 234 | (param $fd $fd)
|
243 |
| - (result $error $errno) |
| 235 | + (result $error (expected (error $errno))) |
244 | 236 | )
|
245 | 237 |
|
246 | 238 | ;;; Return the current offset of a file descriptor.
|
247 | 239 | ;;; Note: This is similar to `lseek(fd, 0, SEEK_CUR)` in POSIX.
|
248 | 240 | (@interface func (export "tell")
|
249 | 241 | (param $fd $fd)
|
250 |
| - (result $error $errno) |
251 | 242 | ;;; The current offset of the file descriptor, relative to the start of the file.
|
252 |
| - (result $offset $filesize) |
| 243 | + (result $error (expected $filesize (error $errno))) |
253 | 244 | )
|
254 | 245 |
|
255 | 246 | ;;; Write to a file descriptor.
|
|
262 | 253 | (param $fd $fd)
|
263 | 254 | ;;; List of scatter/gather vectors from which to retrieve data.
|
264 | 255 | (param $iovs $ciovec_array)
|
265 |
| - (result $error $errno) |
266 | 256 | ;;; The number of bytes written.
|
267 |
| - (result $nwritten $size) |
| 257 | + (result $error (expected $size (error $errno))) |
268 | 258 | )
|
269 | 259 | )
|
0 commit comments