Re:Sortix: small self-hosting OS aiming to be a clean, moder...
by sortie on Saturday March 03, 2018 @10:11AM
(#16509545)
Author here. Like in Linux, libc provides errno on Sortix. The difference is that glibc does "#define errno (*__get_errno_location())" while Sortix libc does "__thread int errno;". linux syscalls return a negative value containing the negated errno, while Sortix system calls use two output registers: The return value register and the errno register. That allows Sortix system calls to legitimately return -42 if they want, which is not possible on Linux. Sortix libc assigns the errno register to the thread local errno if the errno register is non-zero.
[ Parent
| on HN ]
There are no comments on this comment yet.