12 ms·
Slighty off-topic: Over 100 points and zero comments? Is this article so good that there is literally nothing to add, does the comments section at lwn.net serve
by claudius 12y ago
Slighty off-topic: Over 100 points and zero comments? Is this article so good that there is literally nothing to add, does the comments section at lwn.net serve as an appropriate outlet or is there some other obvious reason I’m missing?
Back to topic: The comments there mention that binary-compatibility with other unices might have been a reason to have per-architecture syscall numbers, but fail to explain why the more recent architectures (x86_64 and arm, e.g.) would keep that compatibility – certainly tries to run, say, HP-UX binaries on Linux any longer?
- josephlord 12y agoFollowing your off-topic lead and lacking anything on-topic to say... It seems to be very factual and describe what is with no editorialised position on whether anything is good or bad which reduces the opportunity for an exchange of valid viewpoints. It might be that the article is interesting but without people feeling knowledgeable enough to add much. And if the article doesn't make any significant errors the knowledgeable people won't jump in with corrections.
- lelf 12y agoWe 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.
- akiselev 12y agoFrom the OP (emphasis added): > Originally (in the days of Linux 1.x / 2.0) Linux attempted to be binary compatible to existing Unices on common hardware (the personality(2) system call is also part of this). As time passed, compatibility with other Unices became mostly a non-issue – but now we do need to maintain binary compatibility with older Linux binaries…
- claudius 12y agoI can understand this for “old” architectures (i386), but if a new architecture is added, there are no binaries with which one could be (in)compatible?