From d9a82e9f3c87aa318fb05819249656b43fde15e3 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Tue, 26 May 2026 19:41:59 -0700 Subject: add the ability to bind signal handlers and a useful example one ;) this also involved fixing the failure cases in input.e to handle EINTR correctly. it required a lot of tracing, but now the expected state of the stack is much better commented for next time. many thanks to @cks@mastodon.social who found code in the Go compiler which had the details of what's required in regard to the restorer, which made the whole thing work, and to @snowfox@tech.lgbt who did some experimental testing around the exact requirements. both those contributions are reflected in the documentation added with this CL. additional thanks to everyone who chimed in on the fedi thread, your comments kept us going! Force-Push: yes Change-Id: I97fd89426bf807df5565e011d3665f7e904fa138 --- transform.e | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'transform.e') diff --git a/transform.e b/transform.e index 81e99b6..4004db9 100644 --- a/transform.e +++ b/transform.e @@ -715,6 +715,8 @@ allocate-transform-state s" transform-state" variable dup s" describe" stringcmp 0 = { drop -1 exit } if dup s" describe-all" stringcmp 0 = { drop 0 exit } if dup s" describe-compilation" stringcmp 0 = { drop 0 exit } if + dup s" symbolize-pointer" stringcmp 0 = { drop -1 exit } if + dup s" list-callers" stringcmp 0 = { drop 0 exit } if dup s" forget" stringcmp 0 = { drop -1 exit } if dup s" ," stringcmp 0 = { drop -1 exit } if dup s" make-immediate" stringcmp 0 = { drop 0 exit } if @@ -775,6 +777,29 @@ allocate-transform-state s" transform-state" variable ~ The following is a deliberate omission: interpret. dup s" quit" stringcmp 0 = { drop 0 exit } if + ~ From linux-dynamic.e. + dup s" allocate-timespec" stringcmp 0 = { drop 1 exit } if + dup s" timespec-seconds" stringcmp 0 = { drop 0 exit } if + dup s" timespec-nanoseconds" stringcmp 0 = { drop 0 exit } if + dup s" nanosleep" stringcmp 0 = { drop 0 exit } if + dup s" sys-sigaction" stringcmp 0 = { drop -2 exit } if + dup s" sys-sigaltstack" stringcmp 0 = { drop -1 exit } if + dup s" allocate-sigaction" stringcmp 0 = { drop 1 exit } if + dup s" sigaction-action" stringcmp 0 = { drop 0 exit } if + dup s" sigaction-flags" stringcmp 0 = { drop 0 exit } if + dup s" sigaction-restorer" stringcmp 0 = { drop 0 exit } if + dup s" sigaction-mask" stringcmp 0 = { drop 0 exit } if + dup s" allocate-sigaltstack" stringcmp 0 = { drop 1 exit } if + dup s" sigaltstack-pointer" stringcmp 0 = { drop 0 exit } if + dup s" sigaltstack-flags" stringcmp 0 = { drop 0 exit } if + dup s" sigaltstack-size" stringcmp 0 = { drop 0 exit } if + dup s" prepare-signal-stack" stringcmp 0 = { drop 0 exit } if + ~ The following is a deliberate omission: signal-return-trampoline. + dup s" wrap-signal-handler" stringcmp 0 = { drop 0 exit } if + dup s" bind-signal" stringcmp 0 = { drop -2 exit } if + ~ The following is a deliberate omission: handle-crash. + dup s" install-crash-handler" stringcmp 0 = { drop 0 exit } if + ~ Created by warm-start in execution.e. dup s" log" stringcmp 0 = { drop 1 exit } if dup s" s0" stringcmp 0 = { drop 1 exit } if -- cgit 1.4.1