News for hackers. Stuff that matters.
Re:Echo – Assembly program that prints the first positional ... by dom0 on Monday January 02, 2017 @04:02AM (#13299961)
They just return the negative error number.

Eg. -EINVAL.

Re:Echo – Assembly program that prints the first positional ... by JoshTriplett on Monday January 02, 2017 @04:11AM (#13299999)
And 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.
Re:Echo – Assembly program that prints the first positional ... by userbinator on Monday January 02, 2017 @09:19AM (#13301240)
...which I think is a far superior system to errno. I commented on this before somewhat recently: 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?)