Skip to content

Commit 7c8abf2

Browse files
openkal 0.18.0, openkal-linux 0.19.0, openkal-macos 0.16.0, openkal-windows 0.14.0 (#635)
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent de80324 commit 7c8abf2

7 files changed

Lines changed: 114 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
### Added
1111

12+
- **openkal 0.18.0、openkal-linux 0.19.0、openkal-macos 0.16.0、openkal-windows 0.14.0。** 新的可选接口
13+
`openkal.map`(`KAL_IFACE_MAP`):`kal_map_file` 把文件的一部分映射到地址空间(偏移为 `KAL_MAP_ALIGNMENT`,即
14+
64 KiB 的倍数;读或写、私有或共享),`kal_map_sync` 使共享区域的写入对文件读取可见,`kal_map_release` 按地址与长度
15+
释放。区域不越过文件末尾、不可执行;末页中文件末尾之后的字节读为零。三个实现分别以 mmap、mmap 与 section/view
16+
实现。测试成员 `openkal` 随之移动,并观察 0.18 的映射。GLOBAL 为 GitHub 标签归档,CN 为 GitCode `mcpp-res` 镜像,
17+
sha256 两处一致。
1218
- **mcpplibs.os 0.2.3。** 钉 openkal-linux 0.18.3:目录句柄以 `O_PATH` 打开,进程可搜索而不可读的目录中按绝对名
1319
启动的程序能被找到(Android 应用沙箱,mcpp-community/mcpp#857)。测试成员 `os` 随之移动。GLOBAL 为 GitHub 标签归档,CN 为 GitCode
1420
`mcpp-res` 镜像,sha256 两处一致。

‎pkgs/o/openkal-linux.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.19.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.19.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.19.0/openkal-linux-0.19.0.tar.gz",
26+
},
27+
sha256 = "bd5d13009404c1d87f0828ba9b26d6f28340982901723bcbe7c9a729a5acb331",
28+
},
2229
["0.18.3"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.18.3.tar.gz",
@@ -182,6 +189,13 @@ package = {
182189
},
183190
},
184191
macosx = {
192+
["0.19.0"] = {
193+
url = {
194+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.19.0.tar.gz",
195+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.19.0/openkal-linux-0.19.0.tar.gz",
196+
},
197+
sha256 = "bd5d13009404c1d87f0828ba9b26d6f28340982901723bcbe7c9a729a5acb331",
198+
},
185199
["0.18.3"] = {
186200
url = {
187201
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.18.3.tar.gz",
@@ -345,6 +359,13 @@ package = {
345359
},
346360
},
347361
windows = {
362+
["0.19.0"] = {
363+
url = {
364+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.19.0.tar.gz",
365+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.19.0/openkal-linux-0.19.0.tar.gz",
366+
},
367+
sha256 = "bd5d13009404c1d87f0828ba9b26d6f28340982901723bcbe7c9a729a5acb331",
368+
},
348369
["0.18.3"] = {
349370
url = {
350371
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.18.3.tar.gz",

‎pkgs/o/openkal-macos.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.16.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.16.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.16.0/openkal-macos-0.16.0.tar.gz",
26+
},
27+
sha256 = "9597ad34c49f49da7b62ef81c94bd1ce20dc7c056d897f7f5ffc94e389831c08",
28+
},
2229
["0.15.1"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.15.1.tar.gz",
@@ -175,6 +182,13 @@ package = {
175182
},
176183
},
177184
macosx = {
185+
["0.16.0"] = {
186+
url = {
187+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.16.0.tar.gz",
188+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.16.0/openkal-macos-0.16.0.tar.gz",
189+
},
190+
sha256 = "9597ad34c49f49da7b62ef81c94bd1ce20dc7c056d897f7f5ffc94e389831c08",
191+
},
178192
["0.15.1"] = {
179193
url = {
180194
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.15.1.tar.gz",
@@ -331,6 +345,13 @@ package = {
331345
},
332346
},
333347
windows = {
348+
["0.16.0"] = {
349+
url = {
350+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.16.0.tar.gz",
351+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.16.0/openkal-macos-0.16.0.tar.gz",
352+
},
353+
sha256 = "9597ad34c49f49da7b62ef81c94bd1ce20dc7c056d897f7f5ffc94e389831c08",
354+
},
334355
["0.15.1"] = {
335356
url = {
336357
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.15.1.tar.gz",

‎pkgs/o/openkal-windows.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ package = {
2121

2222
xpm = {
2323
linux = {
24+
["0.14.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.14.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.14.0/openkal-windows-0.14.0.tar.gz",
28+
},
29+
sha256 = "756112f71bd4a2cadd9273dd23d07415d61def3b2ef6e0188e271c27fdc645cd",
30+
},
2431
["0.13.3"] = {
2532
url = {
2633
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.13.3.tar.gz",
@@ -205,6 +212,13 @@ package = {
205212
},
206213
},
207214
macosx = {
215+
["0.14.0"] = {
216+
url = {
217+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.14.0.tar.gz",
218+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.14.0/openkal-windows-0.14.0.tar.gz",
219+
},
220+
sha256 = "756112f71bd4a2cadd9273dd23d07415d61def3b2ef6e0188e271c27fdc645cd",
221+
},
208222
["0.13.3"] = {
209223
url = {
210224
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.13.3.tar.gz",
@@ -389,6 +403,13 @@ package = {
389403
},
390404
},
391405
windows = {
406+
["0.14.0"] = {
407+
url = {
408+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.14.0.tar.gz",
409+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.14.0/openkal-windows-0.14.0.tar.gz",
410+
},
411+
sha256 = "756112f71bd4a2cadd9273dd23d07415d61def3b2ef6e0188e271c27fdc645cd",
412+
},
392413
["0.13.3"] = {
393414
url = {
394415
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.13.3.tar.gz",

‎pkgs/o/openkal.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ package = {
2222

2323
xpm = {
2424
linux = {
25+
["0.18.0"] = {
26+
url = {
27+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.18.0.tar.gz",
28+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.18.0/openkal-0.18.0.tar.gz",
29+
},
30+
sha256 = "d6feb5acff4cb5162dc4306dc0d46b3df67051ccd03894857a03ebf6032dae26",
31+
},
2532
["0.17.1"] = {
2633
url = {
2734
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.17.1.tar.gz",
@@ -143,6 +150,13 @@ package = {
143150
},
144151
},
145152
macosx = {
153+
["0.18.0"] = {
154+
url = {
155+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.18.0.tar.gz",
156+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.18.0/openkal-0.18.0.tar.gz",
157+
},
158+
sha256 = "d6feb5acff4cb5162dc4306dc0d46b3df67051ccd03894857a03ebf6032dae26",
159+
},
146160
["0.17.1"] = {
147161
url = {
148162
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.17.1.tar.gz",
@@ -264,6 +278,13 @@ package = {
264278
},
265279
},
266280
windows = {
281+
["0.18.0"] = {
282+
url = {
283+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.18.0.tar.gz",
284+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.18.0/openkal-0.18.0.tar.gz",
285+
},
286+
sha256 = "d6feb5acff4cb5162dc4306dc0d46b3df67051ccd03894857a03ebf6032dae26",
287+
},
267288
["0.17.1"] = {
268289
url = {
269290
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.17.1.tar.gz",

‎tests/examples/openkal/mcpp.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ name = "openkal-tests"
1818
version = "0.1.0"
1919

2020
[dependencies.mcpplibs]
21-
openkal = "0.17.1"
21+
openkal = "0.18.0"
2222

2323
[target.'cfg(os = "linux")'.dependencies.mcpplibs]
24-
openkal-linux = "0.18.3"
24+
openkal-linux = "0.19.0"
2525

2626
[target.'cfg(os = "macos")'.dependencies.mcpplibs]
27-
openkal-macos = "0.15.1"
27+
openkal-macos = "0.16.0"
2828

2929
[target.'cfg(windows)'.dependencies.mcpplibs]
30-
openkal-windows = "0.13.3"
30+
openkal-windows = "0.14.0"
3131

3232
[target.'cfg(all(os = "linux", env = "musl"))'.dependencies.mcpplibs]
3333
openkal-llvm-runtime = "0.16.9"

‎tests/examples/openkal/tests/kal.cpp‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
// size and has the room; a closed directory's enumeration is refused; and
66
// (0.17) the system is named, this program names itself with the moment it
77
// 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.
8+
// (0.17.1) a joined command line is refused where programs receive vectors;
9+
// (0.18) a file is mapped, the region holds its bytes and zero after its end.
910
// The terminal is not observed here,
1011
// because a test run has none; the implementations observe it on a terminal
1112
// they make.
1213
#include <openkal/env.h>
1314
#include <openkal/fs.h>
15+
#include <openkal/map.h>
1416
#include <openkal/process.h>
1517
#include <openkal/stream.h>
1618
#include <openkal/task.h>
@@ -44,6 +46,7 @@ void room(void* p) {
4446
int main() {
4547
check(KAL_VERSION_MINOR >= 17u || KAL_VERSION_MAJOR > 0u, "the declarations are openkal 0.17 or later");
4648
check(KAL_VERSION_MINOR > 17u || KAL_VERSION_PATCH >= 1u || KAL_VERSION_MAJOR > 0u, "and 0.17.1 or later");
49+
check(KAL_VERSION_MINOR >= 18u || KAL_VERSION_MAJOR > 0u, "and 0.18 or later");
4750
check(kal_version() >= KAL_VERSION, "the implementation is at least as new as the declarations");
4851

4952
probe q{0, 0};
@@ -102,6 +105,22 @@ int main() {
102105
"a joined command line is refused where programs receive vectors");
103106
}
104107

108+
if (root.h && (kal_interfaces() & KAL_IFACE_MAP) != 0) {
109+
kal_file f{};
110+
if (kal_fs_open(root, "okt.m", 5, KAL_OPEN_READ | KAL_OPEN_WRITE | KAL_OPEN_CREATE | KAL_OPEN_TRUNCATE, &f) == kal_ok) {
111+
kal_stream_write(kal_fs_stream(f), "mapped", 6);
112+
void* region = nullptr;
113+
check(kal_map_file(f, 0, 6, 0, &region) == kal_ok, "a file is mapped");
114+
if (region) {
115+
const volatile char* b = static_cast<const char*>(region);
116+
check(b[0] == 'm' && b[5] == 'd' && b[6] == 0, "the region holds the file's bytes and zero after its end");
117+
kal_map_release(region, 6);
118+
}
119+
kal_fs_close_file(f);
120+
}
121+
kal_fs_remove(root, "okt.m", 5);
122+
}
123+
105124
if (failures == 0) kal_stream_write(kal_stdout(), "openkal: held\n", 14);
106125
return failures == 0 ? 0 : 1;
107126
}

0 commit comments

Comments
 (0)