On 04/01/2007 06:56 PM, Robert P. J. Day wrote:
a fairly basic question, but i just want to be clear on terminology.
in robert love's book "linux kernel development" 2ed. (henceforth just
LKD2), love is discussing the available file operations in ch 12, pp.
228-9.
he describes what are pretty clearly userspace calls such as
llseek(), read(), aio_read() and so on as "system calls". that's not
what i understand by the phrase "system calls."
i've always used that description to refer to what love talks about
in ch 5, "system calls." from my perspective, an actual system call
from userspace would look like what love has on p. 73:
#define __NR_foo 283
__syscall0(long, foo)
...
and so on; that is, it *explicitly* uses the _syscalln() macros.
IMHO, a simple call to something like read() and write() is simply a
userspace call which *eventually* invokes the corresponding system
call.
Well, no, read() and write (as examples) are what are called syscalls.
The fact that you as an application programmer would call them via a
library interface is just an implementation detail; libc is kind enough
to provide you with wrapper functions so that you don't have to mess
with knowing how to trap into the kernel and how to provide arguments
(and retrieve the return value) yourself, but that's it -- it doesn't do
anything to your call other than massage it into the correct format. You
still directly call _that_ specific kernel-provided service.
Also imagine that Linux would expand on it's VDSO mechanism (which is
posing as a shared libary already) by actually exporting read() and
write() from it directly. The "clearly userspace" then gets rather less
clear but nothing fundamental has changed. It's just an implementation
detail.
Calling read() and write() and any other function documented in section
2 of the manpages "syscalls" is fully consistent with regular and
expected terminology.
Rene.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ