Context: a simple interpreter on linux x86.
I have a simple 32 bits interpreter and I catch all signals to restart and print a signon message, then continue. The user is probably testing and can decide if he wants to abort the interpreter or go on. If he typed ^C for example to cut a test loop short, it is probably okay to continue with the interpreter. Likewise divide-by-zero can restart a calculation with other parameters.
If the restart address is WARM, I can install a sighandler for this case with the parameters SIGINT WARM NULL and call _NR__signal (48).
If I do the same in 64 bits, all attempts to install a signal handler in this way are met with
-88 : socket operation on non-socket and
-9 : Bad file descriptor
What goes wrong? File descriptors and sockets are nowhere to be seen in the 32 bit version of signal.
Is there an alternative for this?
A c-function (e.g. sigaction) is not acceptable, because there is no linking, and no c-interface with this interpreter.