Page MenuHomeFreeBSD

Let proc_raise() call into pksignal() directly.
ClosedPublic

Authored by ed on Jul 14 2015, 11:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 9:41 AM
Unknown Object (File)
Thu, Dec 19, 4:11 PM
Unknown Object (File)
Sep 17 2024, 11:10 PM
Unknown Object (File)
Sep 17 2024, 4:24 PM
Unknown Object (File)
Sep 14 2024, 10:52 PM
Unknown Object (File)
Sep 11 2024, 7:44 PM
Unknown Object (File)
Sep 2 2024, 4:38 PM
Unknown Object (File)
Jul 6 2024, 10:32 PM
Subscribers

Details

Summary

As discussed with kib@ in response to r285404, don't call into
kern_sigaction() within proc_raise() to reset the signal to the default
action before delivery. We'd better do that during image execution.

Change the code to simply use pksignal(), so we don't waste cycles on
functions like pfind() to look up the currently running process itself.

Test Plan

This change has also been pushed into the cloudabi branch on GitHub. The
raise() tests still seem to pass.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

ed retitled this revision from to Let proc_raise() call into pksignal() directly..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added a reviewer: kib.
kib edited edge metadata.

s/process creation/image execution/ in the explanation.

sys/compat/cloudabi/cloudabi_proc.c
99

Should this condition be sig >= nitems() or sig > nitems ? Zero-indexed element is not a real signal.

This revision is now accepted and ready to land.Jul 14 2015, 11:43 AM
ed edited edge metadata.
In D3076#60795, @kib wrote:

s/process creation/image execution/ in the explanation.

Done!

sys/compat/cloudabi/cloudabi_proc.c
99

We could remove the zero'th element from this array, but it would have the disadvantage that we'd have to write [CLOUDABI_SIG... - 1] = SIG... for every array member and index it using signals[uap->sig - 1]. I decided to be a bit more lazy here and just leave the element in there. This way the intent becomes a bit more obvious.

Alternatively we could remove the [] = designators entirely and list all the signals in the right order, but this way it becomes more clear that we don't map one of the signals incorrectly.

sys/compat/cloudabi/cloudabi_proc.c
99

Ok, I am not about the removal of zero element. The '>=' condition seems to be right thing to do.

This revision was automatically updated to reflect the committed changes.