3 ms·
They just return the negative error number. Eg. -EINVAL.
by dom0 10y ago
They just return the negative error number.
Eg. -EINVAL.
- JoshTriplett 10y agoAnd for syscalls that also have a meaningful return value, the ABI requires that valid errno values fall in the range -1 to -4095, to disambiguate them from any possible return value. Those values can't conflict with valid userspace pointers (since they'd point into kernel space), and syscalls must not allow them to conflict with valid numeric return values.
- userbinator 10y ago...which I think is a far superior system to errno. I commented on this before somewhat recently: https://news.ycombinator.com/item?id=13062421 https://news.ycombinator.com/item?id=13062421 In fact, it's puzzling to me why the errno mechanism was even conceived, as it seems to offer no advantages over returning errors directly (does anyone happen to know?)