|
13 | 13 | // this program is told the memory it occupies and its peak, and a region is |
14 | 14 | // reserved, backed, written, its backing returned and backed again reading |
15 | 15 | // zero, and released; (0.21) where the implementation states it, part of an |
16 | | -// executable region is a file's bytes, read from where the file holds them. |
| 16 | +// executable region is a file's bytes, read from where the file holds them; |
| 17 | +// (0.22) the null device beside a stream at one position is refused, and is |
| 18 | +// refused as unsupported where the implementation does not state it. |
17 | 19 | // The terminal is not observed here, |
18 | 20 | // because a test run has none; the implementations observe it on a terminal |
19 | 21 | // they make. |
@@ -118,6 +120,29 @@ int main() { |
118 | 120 | "a joined command line is refused where programs receive vectors"); |
119 | 121 | } |
120 | 122 |
|
| 123 | + if (root.h) { |
| 124 | + const char* argv[] = { "x" }; |
| 125 | + const kal_uintptr lens[] = { 1 }; |
| 126 | + kal_process p{}; |
| 127 | + if ((kal_process_props() & KAL_PROCESS_PROP_NULL_STREAMS) == 0) { |
| 128 | + const kal_spawn how{ root, root, nullptr, nullptr, 0, KAL_SPAWN_NULL_OUT }; |
| 129 | + check(kal_process_spawn(&how, "x", 1, argv, lens, 1, nullptr, nullptr, 0, nullptr, &p) |
| 130 | + == kal_err_not_supported, |
| 131 | + "the null device is refused where the implementation does not state it"); |
| 132 | + } else if (kal_process_props() & KAL_PROCESS_PROP_CHANNEL) { |
| 133 | + kal_stream mine{}, theirs{}; |
| 134 | + if (kal_process_channel(&mine, &theirs) == kal_ok) { |
| 135 | + const kal_spawn_streams placed{ kal_stream{0}, theirs, kal_stream{0} }; |
| 136 | + const kal_spawn how{ root, root, nullptr, nullptr, 0, KAL_SPAWN_NULL_OUT }; |
| 137 | + check(kal_process_spawn(&how, "x", 1, argv, lens, 1, nullptr, nullptr, 0, &placed, &p) |
| 138 | + == kal_err_invalid, |
| 139 | + "the null device beside a stream at one position is refused"); |
| 140 | + kal_process_channel_close(theirs); |
| 141 | + kal_process_channel_close(mine); |
| 142 | + } |
| 143 | + } |
| 144 | + } |
| 145 | + |
121 | 146 | if (root.h && (kal_interfaces() & KAL_IFACE_MAP) != 0) { |
122 | 147 | kal_file f{}; |
123 | 148 | if (kal_fs_open(root, "okt.m", 5, KAL_OPEN_READ | KAL_OPEN_WRITE | KAL_OPEN_CREATE | KAL_OPEN_TRUNCATE, &f) == kal_ok) { |
|
0 commit comments