News for hackers. Stuff that matters.
Re:Hobby x86 kernel written with Zig by sigjuice on Monday January 06, 2020 @02:59PM (#21972611)
need to drop down to assembly to implement resumable function/fibers to avoid the syscall costs of ucontext/setjmp/longjmp

Which syscalls would be involved in setjmp/longjmp?

Re:Hobby x86 kernel written with Zig by mratsim on Monday January 06, 2020 @03:18PM (#21972800)
Re:Hobby x86 kernel written with Zig by loeg on Monday January 06, 2020 @06:23PM (#21974687)
For inexplicable reasons, ucontext/setjmp/longjmp include signal masks, which, for lack of VDSO implementation, must be obtained by invoking syscalls.

(FreeBSD provides the non-portable _setjmp/_longjmp, which do not preserve signal mask state and avoid the syscall. There are also the POSIX sigsetjmp/siglongjmp, which with savesigs=0 may bypass the syscalls as well. Both FreeBSD and Linux provide the POSIX routines.)