News for hackers. Stuff that matters.
Re:Anatomy of a system call, part 1 by lelf on Friday July 18, 2014 @05:33AM (#8052277)
We don't have that compatibility. Even BSDs and GNU/Linux on x86 have completely different calling conventions (ordinary C ABI vs registers + ptr to memory).

Edit: also Linux is made with completely moronic way to return errors (it uses some negative values as errors).

Re:Anatomy of a system call, part 1 by barrkel on Friday July 18, 2014 @06:27AM (#8052378)
Using the high bit to indicate an error result isn't unknown on other OSes either - see NTSTATUS on Windows, and HRESULT in COM.
Re:Anatomy of a system call, part 1 by lelf on Friday July 18, 2014 @08:28AM (#8052623)
This has nothing to do neither with high bit nor with NTSTATUS. For Linux, some values are errors, all others are normal results. lseek cannot return large value for example. At all.
Re:Anatomy of a system call, part 1 by willvarfar on Friday July 18, 2014 @05:55AM (#8052318)
Please explain better ways for a syscall to return an error that negative status, and explain how OS other than Linux get it right.
Re:Anatomy of a system call, part 1 by justincormack on Friday July 18, 2014 @07:23AM (#8052469)
Its Linux so you don't even need to look at a different OS. Each architecture is different. PowerPC returns the return value and error code in different registers which is very clean.
Re:Anatomy of a system call, part 1 by lelf on Friday July 18, 2014 @08:30AM (#8052631)
By setting cpu flag for example. Pretty standard way.