Take up openkal 0.11's unit: a handle the caller holds, not a flag - #17
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.