3 ms·
Duh! You are right, losing the results of partial read/writes is not acceptable. I guess on x86, completely unportably, you could check whether the current ip i
by gpderetta 10y ago
Duh! You are right, losing the results of partial read/writes is not acceptable. I guess on x86, completely unportably, you could check whether the current ip is pointing to a syscall/int instruction.
- scottlamb 10y agoYou probably want to jump if you're "just before" the syscall, too, though. So you end up with basically this: syscall wrappers: https://github.com/scottlamb/sigsafe/blob/master/src/x86_64-linux/sigsafe_syscalls.S https://github.com/scottlamb/sigsafe/blob/master/src/x86_64-... (probably could do something better with that thread local; and as I mentioned this isn't using vsyscall) signal handler: https://github.com/scottlamb/sigsafe/blob/master/src/x86_64-linux/sighandler_platform.c https://github.com/scottlamb/sigsafe/blob/master/src/x86_64-... (although it bugs me now that I iterate the whole array if the instruction pointer's not in any of the syscalls) and just to be sure, a race checker: https://github.com/scottlamb/sigsafe/blob/master/tests/race_checker/race_checker.c https://github.com/scottlamb/sigsafe/blob/master/tests/race_...