| 1 |
package wasi:filesystem; |
| 2 |
|
| 3 |
interface wasi { |
| 4 |
enum clockid { |
| 5 |
/// The clock measuring real time. Time value zero corresponds with |
| 6 |
/// 1970-01-01T00:00:00Z. |
| 7 |
realtime, |
| 8 |
/// The store-wide monotonic clock, which is defined as a clock measuring |
| 9 |
/// real time, whose value cannot be adjusted and which cannot have negative |
| 10 |
/// clock jumps. The epoch of this clock is undefined. The absolute time |
| 11 |
/// value of this clock therefore has no meaning. |
| 12 |
monotonic, |
| 13 |
} |
| 14 |
|
| 15 |
/// Timestamp in nanoseconds. |
| 16 |
type timestamp = u64; |
| 17 |
|
| 18 |
/// Error codes returned by functions. |
| 19 |
/// Not all of these error codes are returned by the functions provided by this |
| 20 |
/// API/ some are used in higher-level library layers, and others are provided |
| 21 |
/// merely for alignment with POSIX. |
| 22 |
enum errno { |
| 23 |
/// No error occurred. System call completed successfully. |
| 24 |
success, |
| 25 |
/// Argument list too long. |
| 26 |
toobig, |
| 27 |
/// Permission denied. |
| 28 |
access, |
| 29 |
/// Address in use. |
| 30 |
addrinuse, |
| 31 |
/// Address not available. |
| 32 |
addrnotavail, |
| 33 |
/// Address family not supported. |
| 34 |
afnosupport, |
| 35 |
/// Resource unavailable, or operation would block. |
| 36 |
again, |
| 37 |
/// Connection already in progress. |
| 38 |
already, |
| 39 |
/// Bad file descriptor. |
| 40 |
badf, |
| 41 |
/// Bad message. |
| 42 |
badmsg, |
| 43 |
/// Device or resource busy. |
| 44 |
busy, |
| 45 |
/// Operation canceled. |
| 46 |
canceled, |
| 47 |
/// No child processes. |
| 48 |
child, |
| 49 |
/// Connection aborted. |
| 50 |
connaborted, |
| 51 |
/// Connection refused. |
| 52 |
connrefused, |
| 53 |
/// Connection reset. |
| 54 |
connreset, |
| 55 |
/// Resource deadlock would occur. |
| 56 |
deadlk, |
| 57 |
/// Destination address required. |
| 58 |
destaddrreq, |
| 59 |
/// Mathematics argument out of domain of function. |
| 60 |
dom, |
| 61 |
/// Reserved. |
| 62 |
dquot, |
| 63 |
/// File exists. |
| 64 |
exist, |
| 65 |
/// Bad address. |
| 66 |
fault, |
| 67 |
/// File too large. |
| 68 |
fbig, |
| 69 |
/// Host is unreachable. |
| 70 |
hostunreach, |
| 71 |
/// Identifier removed. |
| 72 |
idrm, |
| 73 |
/// Illegal byte sequence. |
| 74 |
ilseq, |
| 75 |
/// Operation in progress. |
| 76 |
inprogress, |
| 77 |
/// Interrupted function. |
| 78 |
intr, |
| 79 |
/// Invalid argument. |
| 80 |
inval, |
| 81 |
/// I/O error. |
| 82 |
io, |
| 83 |
/// Socket is connected. |
| 84 |
isconn, |
| 85 |
/// Is a directory. |
| 86 |
isdir, |
| 87 |
/// Too many levels of symbolic links. |
| 88 |
loop, |
| 89 |
/// File descriptor value too large. |
| 90 |
mfile, |
| 91 |
/// Too many links. |
| 92 |
mlink, |
| 93 |
/// Message too large. |
| 94 |
msgsize, |
| 95 |
/// Reserved. |
| 96 |
multihop, |
| 97 |
/// Filename too long. |
| 98 |
nametoolong, |
| 99 |
/// Network is down. |
| 100 |
netdown, |
| 101 |
/// Connection aborted by network. |
| 102 |
netreset, |
| 103 |
/// Network unreachable. |
| 104 |
netunreach, |
| 105 |
/// Too many files open in system. |
| 106 |
nfile, |
| 107 |
/// No buffer space available. |
| 108 |
nobufs, |
| 109 |
/// No such device. |
| 110 |
nodev, |
| 111 |
/// No such file or directory. |
| 112 |
noent, |
| 113 |
/// Executable file format error. |
| 114 |
noexec, |
| 115 |
/// No locks available. |
| 116 |
nolck, |
| 117 |
/// Reserved. |
| 118 |
nolink, |
| 119 |
/// Not enough space. |
| 120 |
nomem, |
| 121 |
/// No message of the desired type. |
| 122 |
nomsg, |
| 123 |
/// Protocol not available. |
| 124 |
noprotoopt, |
| 125 |
/// No space left on device. |
| 126 |
nospc, |
| 127 |
/// Function not supported. |
| 128 |
nosys, |
| 129 |
/// The socket is not connected. |
| 130 |
notconn, |
| 131 |
/// Not a directory or a symbolic link to a directory. |
| 132 |
notdir, |
| 133 |
/// Directory not empty. |
| 134 |
notempty, |
| 135 |
/// State not recoverable. |
| 136 |
notrecoverable, |
| 137 |
/// Not a socket. |
| 138 |
notsock, |
| 139 |
/// Not supported, or operation not supported on socket. |
| 140 |
notsup, |
| 141 |
/// Inappropriate I/O control operation. |
| 142 |
notty, |
| 143 |
/// No such device or address. |
| 144 |
nxio, |
| 145 |
/// Value too large to be stored in data type. |
| 146 |
overflow, |
| 147 |
/// Previous owner died. |
| 148 |
ownerdead, |
| 149 |
/// Operation not permitted. |
| 150 |
perm, |
| 151 |
/// Broken pipe. |
| 152 |
pipe, |
| 153 |
/// Protocol error. |
| 154 |
proto, |
| 155 |
/// Protocol not supported. |
| 156 |
protonosupport, |
| 157 |
/// Protocol wrong type for socket. |
| 158 |
prototype, |
| 159 |
/// Result too large. |
| 160 |
range, |
| 161 |
/// Read-only file system. |
| 162 |
rofs, |
| 163 |
/// Invalid seek. |
| 164 |
spipe, |
| 165 |
/// No such process. |
| 166 |
srch, |
| 167 |
/// Reserved. |
| 168 |
stale, |
| 169 |
/// Connection timed out. |
| 170 |
timedout, |
| 171 |
/// Text file busy. |
| 172 |
txtbsy, |
| 173 |
/// Cross-device link. |
| 174 |
xdev, |
| 175 |
/// Extension: Capabilities insufficient. |
| 176 |
notcapable, |
| 177 |
} |
| 178 |
} |