As far as I can remember the new `dc` argument added to the `mount`
system call is the only API innovation that I imported from Harvey-OS
in the Jehanne's kernel.
It's a great idea of Ronald G. Minnich, introduced at
72777a1fab
Since he didn't amended the copyright statements in Harvey, I forgot
to amend it here.
Sorry, my fault.
I'm very grateful to Charles Forsyth for creating most of Jehanne's kernel
and to 9front's guys for all the code and ideas they freely share.
Here I make their copyrights explicit as they had been erroneusly omitted
or messed up before. Sorry.
While sending Tflush after a wakeup, we might call sleep.
Since the awake was not yet consumed, the new sleep was interrupted
causing a new Tflush, in an infinite loop that consumes all tags.
After sending the "clone" request to /proc/$pid/ns, the current process
will be moved to the working directory of $pid.
Otherwise the current process could still access the file and folders
on the service providing its dot, even if such service was not visible to $pid.
Also, keeping the original working directory means that the 'cd' line of the
current process's ns file would be different from that of $pid: the two ns
files must match since the command asked for a "clone".
See also https://marc.info/?l=9fans&m=150893734909969&w=2
Calling resrcwait in awake_gc_proc (that is called from pexit and thus
from sys_exits) means that we have to ignore errors that could cause
the syscall to return.
The funny part here was that one single test for newlib showed the
issue by faulting in a note handler AFTER completing with success:
/arch/amd64/qa/lib/newlib/sigchld/213-sigqueue
The fact was that in the executable, the function notifier() was
located just after the exits() function, whose last line was a call
to _exits().
Thus, when the _exits returned, the notifier() code was executed.
In _procfdprint print additional informations in the second column:
E is printed if the file was open with OCEXEC flag
D is printed if the file was open with ORCLOSE flag
Example output:
3 rE 9 46 (0000000000000001 0 00) 8192 13 /dev/cons
Any process X can get a new copy of the namespace of a target
process Y by writing the string "clone" to the ns file of Y.
The same user must own both processes.
The process writing the ns file must be allowed to mount.
The Pgrp of the calling process is then replaced with a new copy of
the Pgrp of the target process.
After the operation, any change done by X to its own namespace does
not affect Y. Also, if mount was forbidden for Y, it will also be
forbidden for X after the clone.
The new header envvars.h contains the names of commonly used
environment variables, such as $user, $ifs, $path and so on.
These defines are useful for Jehanne core applications that
use them to comunicate some values.
They are not strictly required, but having such defines we
can easily change the naming convention (from lowercase to uppercase).
The img_get macro used to subtract 1 to the argument provided before
computing the porinter to the image. I can't remember why it did so.
However the expression was wrong.
Coverity found the issue:
Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
CID: 155616, 155606, 155598, 155597, 155596, 155587,
155580, 155578, 155577, 155576, 155568, 155566
Simply removing the subtraction seems the obvious fix.