Skip to content

Commit d5148c6

Browse files
0.15.1 --- what a started program receives, and the README that says so
The version is a patch: the changes bring the implementation into line with contracts already declared, and no declaration changes. The specification is named by its development line until openkal 0.14.1 is published. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent d5a3208 commit d5148c6

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ for Linux, written on the kernel's own system-call interface.
55

66
```toml
77
[dependencies]
8-
openkal = "0.14.0"
8+
openkal = "0.14.1"
99

1010
[target.'cfg(os = "linux")'.dependencies]
11-
openkal-linux = "0.14.0"
11+
openkal-linux = "0.15.1"
1212
```
1313

1414
## Why it does not use a C library
@@ -101,6 +101,29 @@ resolve an absolute path and report one, and a name of `"."` leaves it able to
101101
do only the first — which version 0.4 did, and which is why `getcwd` could not
102102
have worked above it.
103103

104+
**A started program receives the three streams and its grants, and nothing
105+
else.** Clause 7.13. Every source is first moved above the positions being
106+
filled, so that placing one cannot overwrite another; everything above the
107+
grants is then marked to close on replacement, including what the calling
108+
program itself inherited (`close_range`, from Linux 5.11; `/proc/self/fd` or the
109+
descriptor limit before it). The program is started through a descriptor for its
110+
own file with `O_CLOEXEC`, and only a program that needs an interpreter --- a
111+
`#!` script, or a `binfmt_misc` binary --- keeps that descriptor: the kernel
112+
refuses such a program with `ENOENT` before the point of no return, and the start
113+
is repeated with the flag cleared. Such a script observes `$0` as `/dev/fd/<n>`.
114+
115+
**Granted directories are named in the environment.** A grant arrives as a
116+
descriptor at 3 and upward, and its name in the variable
117+
`KAL_PREOPENS=<pid>{;<fd>,<len>,<name>}`, the arrangement of systemd's
118+
`LISTEN_FDS` and `LISTEN_FDNAMES`. `<pid>` is written by the started process
119+
itself, so a value inherited through a program that does not read it names no
120+
one. A program started with grants enumerates exactly those directories, the
121+
first of which is the directory it regards as the one it was started in; a
122+
program started without them enumerates the working directory and `/`, as
123+
before. A grant names directories to a program that confines itself to its
124+
preopens; it does not confine a program that opens `/` on its own, which is the
125+
environment's responsibility (clause 11, entry 6).
126+
104127
**Interruption is retried, not reported.** A caller cannot distinguish an
105128
interrupted call from a genuine failure without knowledge of the platform, and
106129
an implementation that reports it produces short transfers on any system that

‎mcpp.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
namespace = "mcpplibs"
33
name = "openkal-linux"
4-
version = "0.15.0"
4+
version = "0.15.1"
55
description = "The reference implementation of openkal for Linux, written on the kernel's own system-call interface so that it can be placed beneath a C library as well as above one."
66
license = "Apache-2.0"
77

@@ -63,7 +63,7 @@ provides-interfaces = [
6363
]
6464

6565
[dependencies]
66-
openkal = "0.14.0"
66+
openkal = { git = "https://github.com/mcpplibs/openkal.git", branch = "openkal-0.14.1" }
6767

6868
# The package contributes definitions and no modules. The interface it
6969
# implements is declared by the specification package, which this package

0 commit comments

Comments
 (0)