System call vs POSIX call
Bernd Petrovitsch
bernd at petrovitsch.priv.at
Thu Aug 16 17:05:31 EDT 2018
On Thu, 2018-08-16 at 15:44 -0400, valdis.kletnieks at vt.edu wrote:
> On Thu, 16 Aug 2018 16:29:29 -0000, Nicholas Mc Guire said:
[...]
Generally, POSIX specifies a API and doesn't really care it it's a real
syscall (which crosses the border of user- and kernel-space by
definition), a pure-user-space function or some mixture.
> > Note that you can do system calls directly with system() but that is
> > generaly not how you do it - you to through the glibc calls
> > which do some checks before invoking the actual system call.
>
> system() does a fork/exec of a process.
... via `/bin/sh -c` so it's actually (at least) 2 of both.
> syscall() issues an arbitrary system call, but all marshalling of
> parameters and return codes becomes your problem
... as well as the availability of that syscall at runtime (and glibc
has a lot of compatibility/emulation in that direction).
Not everyone everywhere has a (somewhat) recent kernel.
MfG,
Bernd
--
Bernd Petrovitsch Email : bernd at petrovitsch.priv.at
LUGA : http://www.luga.at
More information about the Kernelnewbies
mailing list