|
4 | 4 | // relies on: a context started with a least stack size is told at least that |
5 | 5 | // size and has the room; a closed directory's enumeration is refused; and |
6 | 6 | // (0.17) the system is named, this program names itself with the moment it |
7 | | -// started, and a rename that does not replace refuses a name that is taken. The terminal is not observed here, |
| 7 | +// started, and a rename that does not replace refuses a name that is taken; |
| 8 | +// (0.17.1) a joined command line is refused where programs receive vectors. |
| 9 | +// The terminal is not observed here, |
8 | 10 | // because a test run has none; the implementations observe it on a terminal |
9 | 11 | // they make. |
10 | 12 | #include <openkal/env.h> |
@@ -41,6 +43,7 @@ void room(void* p) { |
41 | 43 |
|
42 | 44 | int main() { |
43 | 45 | check(KAL_VERSION_MINOR >= 17u || KAL_VERSION_MAJOR > 0u, "the declarations are openkal 0.17 or later"); |
| 46 | + check(KAL_VERSION_MINOR > 17u || KAL_VERSION_PATCH >= 1u || KAL_VERSION_MAJOR > 0u, "and 0.17.1 or later"); |
44 | 47 | check(kal_version() >= KAL_VERSION, "the implementation is at least as new as the declarations"); |
45 | 48 |
|
46 | 49 | probe q{0, 0}; |
@@ -87,6 +90,18 @@ int main() { |
87 | 90 | kal_fs_remove(root, "okt.b", 5); |
88 | 91 | } |
89 | 92 |
|
| 93 | + if ((kal_process_props() & KAL_PROCESS_PROP_ONE_STRING) == 0 && root.h) { |
| 94 | + // Where a program receives a vector, a joined command line has no |
| 95 | + // meaning and the start is refused before anything runs. |
| 96 | + const char* argv[] = { "x" }; |
| 97 | + const kal_uintptr lens[] = { 1 }; |
| 98 | + const kal_spawn how{ root, root, nullptr, nullptr, 0, KAL_SPAWN_ONE_STRING }; |
| 99 | + kal_process p{}; |
| 100 | + check(kal_process_spawn(&how, "x", 1, argv, lens, 1, nullptr, nullptr, 0, nullptr, &p) |
| 101 | + == kal_err_not_supported, |
| 102 | + "a joined command line is refused where programs receive vectors"); |
| 103 | + } |
| 104 | + |
90 | 105 | if (failures == 0) kal_stream_write(kal_stdout(), "openkal: held\n", 14); |
91 | 106 | return failures == 0 ? 0 : 1; |
92 | 107 | } |
0 commit comments