
Anatomy of a system call, part 1 - signa11
http://lwn.net/Articles/604287/
======
claudius
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?

~~~
lelf
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
Please explain better ways for a syscall to return an error that negative
status, and explain how OS other than Linux get it right.

~~~
justincormack
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.

------
p4bl0
It's funny, I was just this morning digging into syscalls and how they work. I
even submitted a link to one of the pages where I learned new things:
[https://news.ycombinator.com/item?id=8052183](https://news.ycombinator.com/item?id=8052183).
Thanks for posting this one!

------
loxs
Technically this is not anatomy, but physiology.

~~~
joiguru
Fascinating language pedantry.

~~~
loxs
I don't think it's pedantry. It's the same as some doctor coming to you with
the words "The Internet is not working".

~~~
Udo
> _It 's the same as some doctor coming to you with the words "The Internet is
> not working"._

The medical equivalent of that would be a patient coming in with "doc, I've go
a pain", and when the MD asks where, they answer "I'm not sure". Which
happens. In both cases, the professionals need to figure out what the
underlying problem is, despite being given unhelpful information.

Now, as far as "The Anatomy of X" is concerned, that's somewhat of an
overloaded expression. In this context, we generally _do_ expect to not only
get structural but also functional information.

If you expect human language to always follow pre-defined conventions, you're
just setting yourself up for a lot of unnecessary grief. Language and the
meaning conveyed by it are naturally subject to context variations, drift, re-
appropriations, and a whole slew of other transformations.

But even linguistically, "The Anatomy of X" is a victimless crime. I guarantee
you that not one reader here clicked on the article and went "oh my, I sure
was hoping they'd just print out the structs involved and left it at that".

 _Anatomy_ is a word overloaded by context in a way _Physiology_ is not. If
the article was named "The Physiology of a System Call", that does invoke a
medical context where none was expected.

~~~
_delirium
The strict distinction between "anatomy" and "physiology" in medicine, with
the former not including description of function but only structure, is also
fairly recent, with older texts frequently using "anatomy" in a broader sense
of "let's look inside and see what parts this has and what they do". The
borrowing of that sense for the non-medical context happened before usage in
medicine became more technical and specific, so more recent developments in
medical jargon haven't changed the more generally understood meaning of the
English word.

In any case, it's an established English word with a well-understood non-
medical meaning that goes back _really_ far in this sense, at least to the
early 17th century, with John Donne's _An Anatomy of the World_ (1611) and
Robert Burton's _The Anatomy of Melancholy_ (1622).

~~~
loxs
Interesting, didn't know this usage is so old. I (non-native) thought that
it's some hipster programmer talk.

~~~
gumby
Strictly speaking it means dissection (to chop up or cut into I would more
colloquially put it), which is appropriate in this case.

(Finally getting some use out of those years of Greek class!)

------
gteno
What the happen here and topic going wrong ??

