[lkml]   [1998]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] getsockname() always fails with EFAULT in 2.1.127pre7
>And just a purely stupid question here.  Why would a kernel function set a
>return value to something like -EFAULT or -EBADF when a user program would
>check against that value with EFAULT or EBADF? Does the - not negate the
>value? I'm not saying it's wrong LOL, because it works. But what does it
>do why is it done that way?

It's set to a -ve value to say that it's an error. The glibc system call
wrappers flip it back to a positive value that the user sees. Return codes
outside the range (-4095..0) are successful result codes.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:45    [W:0.047 / U:3.956 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site