Skip to content

Take up openkal 0.11's unit: a handle the caller holds, not a flag - #17

Merged
Sunrisepeak merged 5 commits into
mainfrom
spawn-is-one-operation
Aug 30, 2026
Merged

Take up openkal 0.11's unit: a handle the caller holds, not a flag#17
Sunrisepeak merged 5 commits into
mainfrom
spawn-is-one-operation

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

The identity is established at the first start --- a job object created here and its handle reported --- so
nothing has to be remembered and no registry appears. `kal_process_terminate'
is one program again; the unit has its own operations.

…e job

`CreateProcessW' has taken a current directory all along; what was missing until
openkal 0.11 was a caller able to say which. It is now `how->work', obtained
through the same `GetFinalPathNameByHandleW' the image path comes from.

⚠️⚠️ KAL_SPAWN_OWN_JOB IS REFUSED, AND NOT BECAUSE THIS SYSTEM CANNOT DO IT --- it
is the system the idea comes from. A job object with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE is exactly the unit the flag describes. What
is missing is somewhere to keep the job: `kal_process' is one machine word and it
holds the process handle, so `kal_process_terminate' could not reach the job
later. The other two implementations need no storage because `getpgid(pid) ==
pid' recovers the fact from the kernel; this one has no equivalent.

⇒ Claiming it would mean a side table keyed by process handle, and a side table
that is wrong under concurrency terminates the WRONG tree. Refused until it can
be done without one --- a smaller lie than "kills sometimes".

The three unclaimed positions and the calls that refuse them are now written
together above kal_process_props, because a word claiming what the next call
declines is the disagreement clause 6.2 exists to prevent.
The identity is established at the first start --- a job object created here and its handle reported --- so
nothing has to be remembered and no registry appears. `kal_process_terminate'
is one program again; the unit has its own operations.
⭐ THE RESHAPE IS WHAT MADE IT POSSIBLE HERE. Under `KAL_SPAWN_OWN_JOB' this had
to recover a job from a process handle and could not; clause 7.1 named that as a
defect of the specification rather than of this file. With the unit a handle the
caller holds, this environment does it by the route it already offers: a job
object is created before it has members, so `kal_process_spawn' assigns the
program it starts and `kal_process_job_enter' assigns the caller.

⚠️ JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE IS DELIBERATELY NOT SET, and
`SetInformationJobObject' is deliberately not even declared. It would make
`kal_process_job_close' end every member --- and closing means only releasing
where a unit is a process group, so one operation would mean two things on two
systems. Not declaring the call is how that stays true by construction.

⚠️ A program that cannot be put into the unit is ENDED rather than handed back:
it would outlive a termination of the unit, which is not the program the caller
asked to start.
…eady has

⭐ AND THIS IS WHY THE INTERFACE IS A WORD RATHER THAN A HANDLER. The
notification here arrives on a context the environment starts for it, which is
nothing like a disposition interrupting whatever was running. An interface
shaped like the other system's signals would have had to pretend one was the
other; a word both can set needs no pretending.

The routine stores and wakes and returns false, so the default handling
proceeds and a program that never reads the word behaves as it always did.
⚠️ The same guard that caught NtLockFile one release ago: "declared in src/*.h
and exported by no .def". Declaring a function this environment provides is half
of it; saying which library it comes from is the other half, and omitting it
still LINKS through a synthesised thunk --- which is why the check exists rather
than being left to the linker.
@Sunrisepeak
Sunrisepeak merged commit b89a163 into main Aug 30, 2026
4 checks passed
@Sunrisepeak
Sunrisepeak deleted the spawn-is-one-operation branch August 30, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant