3 ms·
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). E
by lelf 12y ago
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).
- willvarfar 12y agoPlease explain better ways for a syscall to return an error that negative status, and explain how OS other than Linux get it right.
- justincormack 12y agoIts 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.
- lelf 12y agoBy setting cpu flag for example. Pretty standard way.
- barrkel 12y agoUsing the high bit to indicate an error result isn't unknown on other OSes either - see NTSTATUS on Windows, and HRESULT in COM.
- lelf 12y agoThis 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.