Re: When should positive and negative error codes be used?

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

 



On Thu, Aug 10, 2023 at 02:51:37PM +0800, Junxian Huang wrote:
> Hi all!
> 
> I'm wondering if there is a clear rule for the usage of positive and
> negative values of error codes.
> 
> It seems that negative values are uniformly used in kernel space, but
> both positive and negative values are used in user space. When should
> positive values be used and when should negative values be used?

We always use negative in the kernel

Userspace is supposed to set errno and often return positive err codes
But we have not done a good job there

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux