kobako 0.28.0-aarch64-linux → 0.30.0-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.release-please-manifest.json +1 -1
  3. data/CHANGELOG.md +377 -0
  4. data/README.md +99 -459
  5. data/ROADMAP.md +7 -1
  6. data/SECURITY.md +1 -1
  7. data/crates/kobako-runtime/CHANGELOG.md +354 -0
  8. data/crates/kobako-runtime/README.md +17 -8
  9. data/crates/kobako-runtime/tests/linux_baseline/linux-baseline-expected.txt +16 -0
  10. data/crates/kobako-transport/CHANGELOG.md +23 -0
  11. data/crates/kobako-transport/README.md +6 -5
  12. data/crates/kobako-wasmtime/CHANGELOG.md +265 -0
  13. data/crates/kobako-wasmtime/README.md +13 -7
  14. data/crates/kobako-wasmtime/src/preview1/testsuite-expected.txt +6 -0
  15. data/crates/kobako-wasmtime/witx/typenames.witx +750 -0
  16. data/crates/kobako-wasmtime/witx/wasi_snapshot_preview1.witx +441 -0
  17. data/data/kobako.wasm +0 -0
  18. data/lib/kobako/3.3/kobako.so +0 -0
  19. data/lib/kobako/3.4/kobako.so +0 -0
  20. data/lib/kobako/4.0/kobako.so +0 -0
  21. data/lib/kobako/catalog/extensions.rb +5 -5
  22. data/lib/kobako/catalog/flags.rb +2 -14
  23. data/lib/kobako/catalog/grants.rb +30 -0
  24. data/lib/kobako/catalog/handles.rb +6 -6
  25. data/lib/kobako/catalog/mount.rb +19 -0
  26. data/lib/kobako/catalog/services.rb +13 -2
  27. data/lib/kobako/catalog/snippets.rb +11 -15
  28. data/lib/kobako/catalog.rb +11 -0
  29. data/lib/kobako/codec/decoder.rb +10 -9
  30. data/lib/kobako/codec/ext_types.rb +4 -6
  31. data/lib/kobako/codec/handle_walk.rb +4 -6
  32. data/lib/kobako/codec/nesting.rb +7 -7
  33. data/lib/kobako/codec/state.rb +19 -3
  34. data/lib/kobako/codec/utils.rb +1 -1
  35. data/lib/kobako/codec/value_budget.rb +86 -0
  36. data/lib/kobako/codec.rb +7 -0
  37. data/lib/kobako/context.rb +40 -13
  38. data/lib/kobako/errors.rb +15 -14
  39. data/lib/kobako/filesystem.rb +69 -0
  40. data/lib/kobako/payload/arguments.rb +2 -2
  41. data/lib/kobako/pool.rb +6 -6
  42. data/lib/kobako/sandbox.rb +55 -27
  43. data/lib/kobako/sandbox_options.rb +39 -13
  44. data/lib/kobako/snippet/{binary.rb → bytecode.rb} +2 -2
  45. data/lib/kobako/snippet/source.rb +1 -1
  46. data/lib/kobako/snippet.rb +1 -1
  47. data/lib/kobako/transport/block_failure.rb +35 -0
  48. data/lib/kobako/transport/dispatcher.rb +33 -29
  49. data/lib/kobako/transport/exposure.rb +7 -9
  50. data/lib/kobako/transport/reflection.rb +79 -23
  51. data/lib/kobako/transport/run.rb +5 -5
  52. data/lib/kobako/transport/yielder.rb +9 -31
  53. data/lib/kobako/transport.rb +1 -0
  54. data/lib/kobako/version.rb +1 -1
  55. data/lib/kobako.rb +35 -0
  56. data/release-please-config.json +1 -0
  57. data/sig/kobako/catalog/extensions.rbs +3 -3
  58. data/sig/kobako/catalog/flags.rbs +0 -4
  59. data/sig/kobako/catalog/grants.rbs +13 -0
  60. data/sig/kobako/catalog/handles.rbs +3 -3
  61. data/sig/kobako/catalog/mount.rbs +24 -0
  62. data/sig/kobako/catalog/services.rbs +5 -1
  63. data/sig/kobako/catalog/snippets.rbs +4 -4
  64. data/sig/kobako/catalog.rbs +1 -0
  65. data/sig/kobako/codec/decoder.rbs +1 -1
  66. data/sig/kobako/codec/handle_walk.rbs +1 -1
  67. data/sig/kobako/codec/nesting.rbs +2 -2
  68. data/sig/kobako/codec/state.rbs +7 -1
  69. data/sig/kobako/codec/utils.rbs +1 -1
  70. data/sig/kobako/codec/value_budget.rbs +23 -0
  71. data/sig/kobako/codec.rbs +3 -2
  72. data/sig/kobako/context.rbs +14 -6
  73. data/sig/kobako/errors.rbs +4 -4
  74. data/sig/kobako/filesystem.rbs +93 -0
  75. data/sig/kobako/guest_yielder.rbs +9 -0
  76. data/sig/kobako/payload/arguments.rbs +1 -1
  77. data/sig/kobako/pool.rbs +3 -3
  78. data/sig/kobako/runtime.rbs +21 -49
  79. data/sig/kobako/sandbox.rbs +9 -5
  80. data/sig/kobako/sandbox_options.rbs +25 -3
  81. data/sig/kobako/snapshot.rbs +20 -0
  82. data/sig/kobako/snippet/bytecode.rbs +12 -0
  83. data/sig/kobako/transport/block_failure.rbs +13 -0
  84. data/sig/kobako/transport/dispatcher.rbs +4 -4
  85. data/sig/kobako/transport/exposure.rbs +2 -2
  86. data/sig/kobako/transport/reflection.rbs +14 -1
  87. data/sig/kobako/transport/run.rbs +3 -3
  88. data/sig/kobako/transport/yielder.rbs +3 -7
  89. data/sig/kobako/transport.rbs +3 -3
  90. metadata +30 -8
  91. data/sig/kobako/snippet/binary.rbs +0 -12
@@ -0,0 +1,750 @@
1
+ ;; Type names used by low-level WASI interfaces.
2
+ ;;
3
+ ;; Some content here is derived from [CloudABI](https://github.com/NuxiNL/cloudabi).
4
+ ;;
5
+ ;; This is a `witx` file. See [here](https://github.com/WebAssembly/WASI/blob/main/legacy/tools/witx-docs.md)
6
+ ;; for an explanation of what that means.
7
+
8
+ (typename $size u32)
9
+
10
+ ;;; Non-negative file size or length of a region within a file.
11
+ (typename $filesize u64)
12
+
13
+ ;;; Timestamp in nanoseconds.
14
+ (typename $timestamp u64)
15
+
16
+ ;;; Identifiers for clocks.
17
+ (typename $clockid
18
+ (enum (@witx tag u32)
19
+ ;;; The clock measuring real time. Time value zero corresponds with
20
+ ;;; 1970-01-01T00:00:00Z.
21
+ $realtime
22
+ ;;; The store-wide monotonic clock, which is defined as a clock measuring
23
+ ;;; real time, whose value cannot be adjusted and which cannot have negative
24
+ ;;; clock jumps. The epoch of this clock is undefined. The absolute time
25
+ ;;; value of this clock therefore has no meaning.
26
+ $monotonic
27
+ ;;; The CPU-time clock associated with the current process.
28
+ $process_cputime_id
29
+ ;;; The CPU-time clock associated with the current thread.
30
+ $thread_cputime_id
31
+ )
32
+ )
33
+
34
+ ;;; Error codes returned by functions.
35
+ ;;; Not all of these error codes are returned by the functions provided by this
36
+ ;;; API; some are used in higher-level library layers, and others are provided
37
+ ;;; merely for alignment with POSIX.
38
+ (typename $errno
39
+ (enum (@witx tag u16)
40
+ ;;; No error occurred. System call completed successfully.
41
+ $success
42
+ ;;; Argument list too long.
43
+ $2big
44
+ ;;; Permission denied.
45
+ $acces
46
+ ;;; Address in use.
47
+ $addrinuse
48
+ ;;; Address not available.
49
+ $addrnotavail
50
+ ;;; Address family not supported.
51
+ $afnosupport
52
+ ;;; Resource unavailable, or operation would block.
53
+ $again
54
+ ;;; Connection already in progress.
55
+ $already
56
+ ;;; Bad file descriptor.
57
+ $badf
58
+ ;;; Bad message.
59
+ $badmsg
60
+ ;;; Device or resource busy.
61
+ $busy
62
+ ;;; Operation canceled.
63
+ $canceled
64
+ ;;; No child processes.
65
+ $child
66
+ ;;; Connection aborted.
67
+ $connaborted
68
+ ;;; Connection refused.
69
+ $connrefused
70
+ ;;; Connection reset.
71
+ $connreset
72
+ ;;; Resource deadlock would occur.
73
+ $deadlk
74
+ ;;; Destination address required.
75
+ $destaddrreq
76
+ ;;; Mathematics argument out of domain of function.
77
+ $dom
78
+ ;;; Reserved.
79
+ $dquot
80
+ ;;; File exists.
81
+ $exist
82
+ ;;; Bad address.
83
+ $fault
84
+ ;;; File too large.
85
+ $fbig
86
+ ;;; Host is unreachable.
87
+ $hostunreach
88
+ ;;; Identifier removed.
89
+ $idrm
90
+ ;;; Illegal byte sequence.
91
+ $ilseq
92
+ ;;; Operation in progress.
93
+ $inprogress
94
+ ;;; Interrupted function.
95
+ $intr
96
+ ;;; Invalid argument.
97
+ $inval
98
+ ;;; I/O error.
99
+ $io
100
+ ;;; Socket is connected.
101
+ $isconn
102
+ ;;; Is a directory.
103
+ $isdir
104
+ ;;; Too many levels of symbolic links.
105
+ $loop
106
+ ;;; File descriptor value too large.
107
+ $mfile
108
+ ;;; Too many links.
109
+ $mlink
110
+ ;;; Message too large.
111
+ $msgsize
112
+ ;;; Reserved.
113
+ $multihop
114
+ ;;; Filename too long.
115
+ $nametoolong
116
+ ;;; Network is down.
117
+ $netdown
118
+ ;;; Connection aborted by network.
119
+ $netreset
120
+ ;;; Network unreachable.
121
+ $netunreach
122
+ ;;; Too many files open in system.
123
+ $nfile
124
+ ;;; No buffer space available.
125
+ $nobufs
126
+ ;;; No such device.
127
+ $nodev
128
+ ;;; No such file or directory.
129
+ $noent
130
+ ;;; Executable file format error.
131
+ $noexec
132
+ ;;; No locks available.
133
+ $nolck
134
+ ;;; Reserved.
135
+ $nolink
136
+ ;;; Not enough space.
137
+ $nomem
138
+ ;;; No message of the desired type.
139
+ $nomsg
140
+ ;;; Protocol not available.
141
+ $noprotoopt
142
+ ;;; No space left on device.
143
+ $nospc
144
+ ;;; Function not supported.
145
+ $nosys
146
+ ;;; The socket is not connected.
147
+ $notconn
148
+ ;;; Not a directory or a symbolic link to a directory.
149
+ $notdir
150
+ ;;; Directory not empty.
151
+ $notempty
152
+ ;;; State not recoverable.
153
+ $notrecoverable
154
+ ;;; Not a socket.
155
+ $notsock
156
+ ;;; Not supported, or operation not supported on socket.
157
+ $notsup
158
+ ;;; Inappropriate I/O control operation.
159
+ $notty
160
+ ;;; No such device or address.
161
+ $nxio
162
+ ;;; Value too large to be stored in data type.
163
+ $overflow
164
+ ;;; Previous owner died.
165
+ $ownerdead
166
+ ;;; Operation not permitted.
167
+ $perm
168
+ ;;; Broken pipe.
169
+ $pipe
170
+ ;;; Protocol error.
171
+ $proto
172
+ ;;; Protocol not supported.
173
+ $protonosupport
174
+ ;;; Protocol wrong type for socket.
175
+ $prototype
176
+ ;;; Result too large.
177
+ $range
178
+ ;;; Read-only file system.
179
+ $rofs
180
+ ;;; Invalid seek.
181
+ $spipe
182
+ ;;; No such process.
183
+ $srch
184
+ ;;; Reserved.
185
+ $stale
186
+ ;;; Connection timed out.
187
+ $timedout
188
+ ;;; Text file busy.
189
+ $txtbsy
190
+ ;;; Cross-device link.
191
+ $xdev
192
+ ;;; Extension: Capabilities insufficient.
193
+ $notcapable
194
+ )
195
+ )
196
+
197
+ ;;; File descriptor rights, determining which actions may be performed.
198
+ (typename $rights
199
+ (flags (@witx repr u64)
200
+ ;;; The right to invoke `fd_datasync`.
201
+ ;;
202
+ ;;; If `path_open` is set, includes the right to invoke
203
+ ;;; `path_open` with `fdflags::dsync`.
204
+ $fd_datasync
205
+ ;;; The right to invoke `fd_read` and `sock_recv`.
206
+ ;;
207
+ ;;; If `rights::fd_seek` is set, includes the right to invoke `fd_pread`.
208
+ $fd_read
209
+ ;;; The right to invoke `fd_seek`. This flag implies `rights::fd_tell`.
210
+ $fd_seek
211
+ ;;; The right to invoke `fd_fdstat_set_flags`.
212
+ $fd_fdstat_set_flags
213
+ ;;; The right to invoke `fd_sync`.
214
+ ;;
215
+ ;;; If `path_open` is set, includes the right to invoke
216
+ ;;; `path_open` with `fdflags::rsync` and `fdflags::dsync`.
217
+ $fd_sync
218
+ ;;; The right to invoke `fd_seek` in such a way that the file offset
219
+ ;;; remains unaltered (i.e., `whence::cur` with offset zero), or to
220
+ ;;; invoke `fd_tell`.
221
+ $fd_tell
222
+ ;;; The right to invoke `fd_write` and `sock_send`.
223
+ ;;; If `rights::fd_seek` is set, includes the right to invoke `fd_pwrite`.
224
+ $fd_write
225
+ ;;; The right to invoke `fd_advise`.
226
+ $fd_advise
227
+ ;;; The right to invoke `fd_allocate`.
228
+ $fd_allocate
229
+ ;;; The right to invoke `path_create_directory`.
230
+ $path_create_directory
231
+ ;;; If `path_open` is set, the right to invoke `path_open` with `oflags::creat`.
232
+ $path_create_file
233
+ ;;; The right to invoke `path_link` with the file descriptor as the
234
+ ;;; source directory.
235
+ $path_link_source
236
+ ;;; The right to invoke `path_link` with the file descriptor as the
237
+ ;;; target directory.
238
+ $path_link_target
239
+ ;;; The right to invoke `path_open`.
240
+ $path_open
241
+ ;;; The right to invoke `fd_readdir`.
242
+ $fd_readdir
243
+ ;;; The right to invoke `path_readlink`.
244
+ $path_readlink
245
+ ;;; The right to invoke `path_rename` with the file descriptor as the source directory.
246
+ $path_rename_source
247
+ ;;; The right to invoke `path_rename` with the file descriptor as the target directory.
248
+ $path_rename_target
249
+ ;;; The right to invoke `path_filestat_get`.
250
+ $path_filestat_get
251
+ ;;; The right to change a file's size (there is no `path_filestat_set_size`).
252
+ ;;; If `path_open` is set, includes the right to invoke `path_open` with `oflags::trunc`.
253
+ $path_filestat_set_size
254
+ ;;; The right to invoke `path_filestat_set_times`.
255
+ $path_filestat_set_times
256
+ ;;; The right to invoke `fd_filestat_get`.
257
+ $fd_filestat_get
258
+ ;;; The right to invoke `fd_filestat_set_size`.
259
+ $fd_filestat_set_size
260
+ ;;; The right to invoke `fd_filestat_set_times`.
261
+ $fd_filestat_set_times
262
+ ;;; The right to invoke `path_symlink`.
263
+ $path_symlink
264
+ ;;; The right to invoke `path_remove_directory`.
265
+ $path_remove_directory
266
+ ;;; The right to invoke `path_unlink_file`.
267
+ $path_unlink_file
268
+ ;;; If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`.
269
+ ;;; If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`.
270
+ $poll_fd_readwrite
271
+ ;;; The right to invoke `sock_shutdown`.
272
+ $sock_shutdown
273
+ ;;; The right to invoke `sock_accept`.
274
+ $sock_accept
275
+ )
276
+ )
277
+
278
+ ;;; A file descriptor handle.
279
+ (typename $fd (handle))
280
+
281
+ ;;; A region of memory for scatter/gather reads.
282
+ (typename $iovec
283
+ (record
284
+ ;;; The address of the buffer to be filled.
285
+ (field $buf (@witx pointer u8))
286
+ ;;; The length of the buffer to be filled.
287
+ (field $buf_len $size)
288
+ )
289
+ )
290
+
291
+ ;;; A region of memory for scatter/gather writes.
292
+ (typename $ciovec
293
+ (record
294
+ ;;; The address of the buffer to be written.
295
+ (field $buf (@witx const_pointer u8))
296
+ ;;; The length of the buffer to be written.
297
+ (field $buf_len $size)
298
+ )
299
+ )
300
+
301
+ (typename $iovec_array (list $iovec))
302
+ (typename $ciovec_array (list $ciovec))
303
+
304
+ ;;; Relative offset within a file.
305
+ (typename $filedelta s64)
306
+
307
+ ;;; The position relative to which to set the offset of the file descriptor.
308
+ (typename $whence
309
+ (enum (@witx tag u8)
310
+ ;;; Seek relative to start-of-file.
311
+ $set
312
+ ;;; Seek relative to current position.
313
+ $cur
314
+ ;;; Seek relative to end-of-file.
315
+ $end
316
+ )
317
+ )
318
+
319
+ ;;; A reference to the offset of a directory entry.
320
+ ;;;
321
+ ;;; The value 0 signifies the start of the directory.
322
+ (typename $dircookie u64)
323
+
324
+ ;;; The type for the `dirent::d_namlen` field of `dirent` struct.
325
+ (typename $dirnamlen u32)
326
+
327
+ ;;; File serial number that is unique within its file system.
328
+ (typename $inode u64)
329
+
330
+ ;;; The type of a file descriptor or file.
331
+ (typename $filetype
332
+ (enum (@witx tag u8)
333
+ ;;; The type of the file descriptor or file is unknown or is different from any of the other types specified.
334
+ $unknown
335
+ ;;; The file descriptor or file refers to a block device inode.
336
+ $block_device
337
+ ;;; The file descriptor or file refers to a character device inode.
338
+ $character_device
339
+ ;;; The file descriptor or file refers to a directory inode.
340
+ $directory
341
+ ;;; The file descriptor or file refers to a regular file inode.
342
+ $regular_file
343
+ ;;; The file descriptor or file refers to a datagram socket.
344
+ $socket_dgram
345
+ ;;; The file descriptor or file refers to a byte-stream socket.
346
+ $socket_stream
347
+ ;;; The file refers to a symbolic link inode.
348
+ $symbolic_link
349
+ )
350
+ )
351
+
352
+ ;;; A directory entry.
353
+ (typename $dirent
354
+ (record
355
+ ;;; The offset of the next directory entry stored in this directory.
356
+ (field $d_next $dircookie)
357
+ ;;; The serial number of the file referred to by this directory entry.
358
+ (field $d_ino $inode)
359
+ ;;; The length of the name of the directory entry.
360
+ (field $d_namlen $dirnamlen)
361
+ ;;; The type of the file referred to by this directory entry.
362
+ (field $d_type $filetype)
363
+ )
364
+ )
365
+
366
+ ;;; File or memory access pattern advisory information.
367
+ (typename $advice
368
+ (enum (@witx tag u8)
369
+ ;;; The application has no advice to give on its behavior with respect to the specified data.
370
+ $normal
371
+ ;;; The application expects to access the specified data sequentially from lower offsets to higher offsets.
372
+ $sequential
373
+ ;;; The application expects to access the specified data in a random order.
374
+ $random
375
+ ;;; The application expects to access the specified data in the near future.
376
+ $willneed
377
+ ;;; The application expects that it will not access the specified data in the near future.
378
+ $dontneed
379
+ ;;; The application expects to access the specified data once and then not reuse it thereafter.
380
+ $noreuse
381
+ )
382
+ )
383
+
384
+ ;;; File descriptor flags.
385
+ (typename $fdflags
386
+ (flags (@witx repr u16)
387
+ ;;; Append mode: Data written to the file is always appended to the file's end.
388
+ $append
389
+ ;;; Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
390
+ $dsync
391
+ ;;; Non-blocking mode.
392
+ $nonblock
393
+ ;;; Synchronized read I/O operations.
394
+ $rsync
395
+ ;;; Write according to synchronized I/O file integrity completion. In
396
+ ;;; addition to synchronizing the data stored in the file, the implementation
397
+ ;;; may also synchronously update the file's metadata.
398
+ $sync
399
+ )
400
+ )
401
+
402
+ ;;; File descriptor attributes.
403
+ (typename $fdstat
404
+ (record
405
+ ;;; File type.
406
+ (field $fs_filetype $filetype)
407
+ ;;; File descriptor flags.
408
+ (field $fs_flags $fdflags)
409
+ ;;; Rights that apply to this file descriptor.
410
+ (field $fs_rights_base $rights)
411
+ ;;; Maximum set of rights that may be installed on new file descriptors that
412
+ ;;; are created through this file descriptor, e.g., through `path_open`.
413
+ (field $fs_rights_inheriting $rights)
414
+ )
415
+ )
416
+
417
+ ;;; Identifier for a device containing a file system. Can be used in combination
418
+ ;;; with `inode` to uniquely identify a file or directory in the filesystem.
419
+ (typename $device u64)
420
+
421
+ ;;; Which file time attributes to adjust.
422
+ (typename $fstflags
423
+ (flags (@witx repr u16)
424
+ ;;; Adjust the last data access timestamp to the value stored in `filestat::atim`.
425
+ $atim
426
+ ;;; Adjust the last data access timestamp to the time of clock `clockid::realtime`.
427
+ $atim_now
428
+ ;;; Adjust the last data modification timestamp to the value stored in `filestat::mtim`.
429
+ $mtim
430
+ ;;; Adjust the last data modification timestamp to the time of clock `clockid::realtime`.
431
+ $mtim_now
432
+ )
433
+ )
434
+
435
+ ;;; Flags determining the method of how paths are resolved.
436
+ (typename $lookupflags
437
+ (flags (@witx repr u32)
438
+ ;;; As long as the resolved path corresponds to a symbolic link, it is expanded.
439
+ $symlink_follow
440
+ )
441
+ )
442
+
443
+ ;;; Open flags used by `path_open`.
444
+ (typename $oflags
445
+ (flags (@witx repr u16)
446
+ ;;; Create file if it does not exist.
447
+ $creat
448
+ ;;; Fail if not a directory.
449
+ $directory
450
+ ;;; Fail if file already exists.
451
+ $excl
452
+ ;;; Truncate file to size 0.
453
+ $trunc
454
+ )
455
+ )
456
+
457
+ ;;; Number of hard links to an inode.
458
+ (typename $linkcount u64)
459
+
460
+ ;;; File attributes.
461
+ (typename $filestat
462
+ (record
463
+ ;;; Device ID of device containing the file.
464
+ (field $dev $device)
465
+ ;;; File serial number.
466
+ (field $ino $inode)
467
+ ;;; File type.
468
+ (field $filetype $filetype)
469
+ ;;; Number of hard links to the file.
470
+ (field $nlink $linkcount)
471
+ ;;; For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link.
472
+ (field $size $filesize)
473
+ ;;; Last data access timestamp.
474
+ (field $atim $timestamp)
475
+ ;;; Last data modification timestamp.
476
+ (field $mtim $timestamp)
477
+ ;;; Last file status change timestamp.
478
+ (field $ctim $timestamp)
479
+ )
480
+ )
481
+
482
+ ;;; User-provided value that may be attached to objects that is retained when
483
+ ;;; extracted from the implementation.
484
+ (typename $userdata u64)
485
+
486
+ ;;; Type of a subscription to an event or its occurrence.
487
+ (typename $eventtype
488
+ (enum (@witx tag u8)
489
+ ;;; The time value of clock `subscription_clock::id` has
490
+ ;;; reached timestamp `subscription_clock::timeout`.
491
+ $clock
492
+ ;;; File descriptor `subscription_fd_readwrite::file_descriptor` has data
493
+ ;;; available for reading. This event always triggers for regular files.
494
+ $fd_read
495
+ ;;; File descriptor `subscription_fd_readwrite::file_descriptor` has capacity
496
+ ;;; available for writing. This event always triggers for regular files.
497
+ $fd_write
498
+ )
499
+ )
500
+
501
+ ;;; The state of the file descriptor subscribed to with
502
+ ;;; `eventtype::fd_read` or `eventtype::fd_write`.
503
+ (typename $eventrwflags
504
+ (flags (@witx repr u16)
505
+ ;;; The peer of this socket has closed or disconnected.
506
+ $fd_readwrite_hangup
507
+ )
508
+ )
509
+
510
+ ;;; The contents of an `event` when type is `eventtype::fd_read` or
511
+ ;;; `eventtype::fd_write`.
512
+ (typename $event_fd_readwrite
513
+ (record
514
+ ;;; The number of bytes available for reading or writing.
515
+ (field $nbytes $filesize)
516
+ ;;; The state of the file descriptor.
517
+ (field $flags $eventrwflags)
518
+ )
519
+ )
520
+
521
+ ;;; An event that occurred.
522
+ (typename $event
523
+ (record
524
+ ;;; User-provided value that got attached to `subscription::userdata`.
525
+ (field $userdata $userdata)
526
+ ;;; If non-zero, an error that occurred while processing the subscription request.
527
+ (field $error $errno)
528
+ ;;; The type of event that occurred
529
+ (field $type $eventtype)
530
+ ;;; The contents of the event, if it is an `eventtype::fd_read` or
531
+ ;;; `eventtype::fd_write`. `eventtype::clock` events ignore this field.
532
+ (field $fd_readwrite $event_fd_readwrite)
533
+ )
534
+ )
535
+
536
+ ;;; Flags determining how to interpret the timestamp provided in
537
+ ;;; `subscription_clock::timeout`.
538
+ (typename $subclockflags
539
+ (flags (@witx repr u16)
540
+ ;;; If set, treat the timestamp provided in
541
+ ;;; `subscription_clock::timeout` as an absolute timestamp of clock
542
+ ;;; `subscription_clock::id`. If clear, treat the timestamp
543
+ ;;; provided in `subscription_clock::timeout` relative to the
544
+ ;;; current time value of clock `subscription_clock::id`.
545
+ $subscription_clock_abstime
546
+ )
547
+ )
548
+
549
+ ;;; The contents of a `subscription` when type is `eventtype::clock`.
550
+ (typename $subscription_clock
551
+ (record
552
+ ;;; The clock against which to compare the timestamp.
553
+ (field $id $clockid)
554
+ ;;; The absolute or relative timestamp.
555
+ (field $timeout $timestamp)
556
+ ;;; The amount of time that the implementation may wait additionally
557
+ ;;; to coalesce with other events.
558
+ (field $precision $timestamp)
559
+ ;;; Flags specifying whether the timeout is absolute or relative
560
+ (field $flags $subclockflags)
561
+ )
562
+ )
563
+
564
+ ;;; The contents of a `subscription` when type is type is
565
+ ;;; `eventtype::fd_read` or `eventtype::fd_write`.
566
+ (typename $subscription_fd_readwrite
567
+ (record
568
+ ;;; The file descriptor on which to wait for it to become ready for reading or writing.
569
+ (field $file_descriptor $fd)
570
+ )
571
+ )
572
+
573
+ ;;; The contents of a `subscription`.
574
+ (typename $subscription_u
575
+ (union
576
+ (@witx tag $eventtype)
577
+ $subscription_clock
578
+ $subscription_fd_readwrite
579
+ $subscription_fd_readwrite
580
+ )
581
+ )
582
+
583
+ ;;; Subscription to an event.
584
+ (typename $subscription
585
+ (record
586
+ ;;; User-provided value that is attached to the subscription in the
587
+ ;;; implementation and returned through `event::userdata`.
588
+ (field $userdata $userdata)
589
+ ;;; The type of the event to which to subscribe, and its contents
590
+ (field $u $subscription_u)
591
+ )
592
+ )
593
+
594
+ ;;; Exit code generated by a process when exiting.
595
+ (typename $exitcode u32)
596
+
597
+ ;;; Signal condition.
598
+ (typename $signal
599
+ (enum (@witx tag u8)
600
+ ;;; No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
601
+ ;;; so this value is reserved.
602
+ $none
603
+ ;;; Hangup.
604
+ ;;; Action: Terminates the process.
605
+ $hup
606
+ ;;; Terminate interrupt signal.
607
+ ;;; Action: Terminates the process.
608
+ $int
609
+ ;;; Terminal quit signal.
610
+ ;;; Action: Terminates the process.
611
+ $quit
612
+ ;;; Illegal instruction.
613
+ ;;; Action: Terminates the process.
614
+ $ill
615
+ ;;; Trace/breakpoint trap.
616
+ ;;; Action: Terminates the process.
617
+ $trap
618
+ ;;; Process abort signal.
619
+ ;;; Action: Terminates the process.
620
+ $abrt
621
+ ;;; Access to an undefined portion of a memory object.
622
+ ;;; Action: Terminates the process.
623
+ $bus
624
+ ;;; Erroneous arithmetic operation.
625
+ ;;; Action: Terminates the process.
626
+ $fpe
627
+ ;;; Kill.
628
+ ;;; Action: Terminates the process.
629
+ $kill
630
+ ;;; User-defined signal 1.
631
+ ;;; Action: Terminates the process.
632
+ $usr1
633
+ ;;; Invalid memory reference.
634
+ ;;; Action: Terminates the process.
635
+ $segv
636
+ ;;; User-defined signal 2.
637
+ ;;; Action: Terminates the process.
638
+ $usr2
639
+ ;;; Write on a pipe with no one to read it.
640
+ ;;; Action: Ignored.
641
+ $pipe
642
+ ;;; Alarm clock.
643
+ ;;; Action: Terminates the process.
644
+ $alrm
645
+ ;;; Termination signal.
646
+ ;;; Action: Terminates the process.
647
+ $term
648
+ ;;; Child process terminated, stopped, or continued.
649
+ ;;; Action: Ignored.
650
+ $chld
651
+ ;;; Continue executing, if stopped.
652
+ ;;; Action: Continues executing, if stopped.
653
+ $cont
654
+ ;;; Stop executing.
655
+ ;;; Action: Stops executing.
656
+ $stop
657
+ ;;; Terminal stop signal.
658
+ ;;; Action: Stops executing.
659
+ $tstp
660
+ ;;; Background process attempting read.
661
+ ;;; Action: Stops executing.
662
+ $ttin
663
+ ;;; Background process attempting write.
664
+ ;;; Action: Stops executing.
665
+ $ttou
666
+ ;;; High bandwidth data is available at a socket.
667
+ ;;; Action: Ignored.
668
+ $urg
669
+ ;;; CPU time limit exceeded.
670
+ ;;; Action: Terminates the process.
671
+ $xcpu
672
+ ;;; File size limit exceeded.
673
+ ;;; Action: Terminates the process.
674
+ $xfsz
675
+ ;;; Virtual timer expired.
676
+ ;;; Action: Terminates the process.
677
+ $vtalrm
678
+ ;;; Profiling timer expired.
679
+ ;;; Action: Terminates the process.
680
+ $prof
681
+ ;;; Window changed.
682
+ ;;; Action: Ignored.
683
+ $winch
684
+ ;;; I/O possible.
685
+ ;;; Action: Terminates the process.
686
+ $poll
687
+ ;;; Power failure.
688
+ ;;; Action: Terminates the process.
689
+ $pwr
690
+ ;;; Bad system call.
691
+ ;;; Action: Terminates the process.
692
+ $sys
693
+ )
694
+ )
695
+
696
+ ;;; Flags provided to `sock_recv`.
697
+ (typename $riflags
698
+ (flags (@witx repr u16)
699
+ ;;; Returns the message without removing it from the socket's receive queue.
700
+ $recv_peek
701
+ ;;; On byte-stream sockets, block until the full amount of data can be returned.
702
+ $recv_waitall
703
+ )
704
+ )
705
+
706
+ ;;; Flags returned by `sock_recv`.
707
+ (typename $roflags
708
+ (flags (@witx repr u16)
709
+ ;;; Returned by `sock_recv`: Message data has been truncated.
710
+ $recv_data_truncated
711
+ )
712
+ )
713
+
714
+ ;;; Flags provided to `sock_send`. As there are currently no flags
715
+ ;;; defined, it must be set to zero.
716
+ (typename $siflags u16)
717
+
718
+ ;;; Which channels on a socket to shut down.
719
+ (typename $sdflags
720
+ (flags (@witx repr u8)
721
+ ;;; Disables further receive operations.
722
+ $rd
723
+ ;;; Disables further send operations.
724
+ $wr
725
+ )
726
+ )
727
+
728
+ ;;; Identifiers for preopened capabilities.
729
+ (typename $preopentype
730
+ (enum (@witx tag u8)
731
+ ;;; A pre-opened directory.
732
+ $dir
733
+ )
734
+ )
735
+
736
+ ;;; The contents of a $prestat when type is `preopentype::dir`.
737
+ (typename $prestat_dir
738
+ (record
739
+ ;;; The length of the directory name for use with `fd_prestat_dir_name`.
740
+ (field $pr_name_len $size)
741
+ )
742
+ )
743
+
744
+ ;;; Information about a pre-opened capability.
745
+ (typename $prestat
746
+ (union (@witx tag $preopentype)
747
+ $prestat_dir
748
+ )
749
+ )
750
+