Commit 472be94
authored
Record what a placed stream outlives, and the value two interfaces disagree about (#18)
Two properties of kal_spawn_streams that an implementation and a caller have had
to discover by running. Neither declaration changes and neither is added to, so
the surface and clause 8 are untouched.
A STREAM PLACED IN A SPAWN IS THE STARTED PROGRAM'S. kal_process_channel already
requires a caller to release the far end after the spawn --- a parent that does
not never observes the end of input on its own --- so an implementation that did
not carry the stream across would make that instruction impossible to follow.
The same holds for a caller that opens a file in order to place its stream, and
that caller had nothing to read.
ZERO IS RESERVED IN THIS STRUCTURE AND IN NO OTHER. kal_stream has no
distinguished value, and an implementation whose streams are its environment's
own descriptors answers kal_stdin() with zero; openkal-linux does. The two
readings agree at position `in' and cannot be told apart anywhere else, so a
caller that places its own standard input at position `out' is asking for
something this structure cannot express. Recorded with what a caller should do
about it --- report the request as unsupported rather than pass on a word that
will be read as inheritance --- and with the one thing an implementation can do
to remove the ambiguity for every caller.
Found by openkal-musl while answering openkal-linux#13: classifying "this
descriptor has no stream" by the handle's VALUE refused every spawn, because the
value zero is standard input.1 parent 8ed32a6 commit 472be94
1 file changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
21 | 55 | | |
22 | 56 | | |
23 | 57 | | |
| |||
0 commit comments