is errno supposed to be positive or negative?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Well, ok, errno is supposed to be zero, but in the rare cases where it's
not, what is intended?

Assuming ESOMETHING is always positive, in userspace errno is
positive, e.g. you test for errno == EBADF.

In barebox however most assignments use

	errno = -ESOMETHING

but there are also some tests and assignments without minus. barebox'
perror expects a negative errno which is also different from POSIX'
perror. strerror uses positive semantics in both barebox and POSIX.

I'd vote to fix barebox to use the same semantic for errno (and perror)
as POSIX.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux