3 ms·
Interesting that nolibc reproduces one of the greatest misfeatures (obviously heavily imho) of libc, the errno. At least it is sort of optional there.
by zokier 5y ago
Interesting that nolibc reproduces one of the greatest misfeatures (obviously heavily imho) of libc, the errno. At least it is sort of optional there.
- matheusmoreira 5y agoI agree. That's one thing I don't like about the kernel header. Linux system calls already have a good interface, they return error codes that consist of negated errno constants. Since we're not using the C library, we might as well do things right and remove global variables. The kernel developers implemented nolibc.h with 3 levels of abstraction: system call entry point, function wrappers and libc interface. They set errno in the libc interface. Personally I don't see the point. > The third level is the libc call definition. > It exposes the lower raw sys_<name>() calls in a way that looks like what a libc usually does, takes care of specific input values, and of setting errno upon error. Defining NOLIBC_IGNORE_ERRNO solves the problem!
- remram 5y agoIf it's trying to be a drop-in replacement, it has to have the same API... You could also wonder why they spelled CREAT without an E again, with the same answer.