From: der.herr@hofr.at (Nicholas Mc Guire)
To: kernelnewbies@lists.kernelnewbies.org
Subject: System call vs POSIX call
Date: Thu, 16 Aug 2018 16:29:29 +0000 [thread overview]
Message-ID: <20180816162929.GA12967@osadl.at> (raw)
In-Reply-To: <CAPY=qRTqzM=q8P0n4SWvMhxoWttv8ZqEReq3vQmkBjCG-Nv3NA@mail.gmail.com>
On Thu, Aug 16, 2018 at 09:51:05PM +0530, Subhashini Rao Beerisetty wrote:
> Hi All,
>
> I'm trying to get the difference between system call and POSIX call. System
> calls are user mode API's (open(), close(), ioctl(),...) gets the kernel
> service via software interrupt. What about POSIX calls and how it differs
> with the system call.? Can anyone clarify me on this.
glibc is the library that connects user-space libs/apps to the
system call interface (unistd.h basically) so if you do an
open() in user-space you are calling glibc and that can call
sys_open() but there are POSIX calls that will not necessarily
do a system call if they can handle the request with available
resources or with cached data. So there is no 1:1 mapping at
runtime from POSIX call to system call - and there can be multiple
POSIX calls that map to a single system call (e.g. printf -> write)
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.
Does that clarify it ?
thx!
hofrat
next prev parent reply other threads:[~2018-08-16 16:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-16 16:21 System call vs POSIX call Subhashini Rao Beerisetty
2018-08-16 16:29 ` Nicholas Mc Guire [this message]
2018-08-16 19:44 ` valdis.kletnieks at vt.edu
2018-08-16 21:05 ` Bernd Petrovitsch
2018-08-17 0:49 ` Nicholas Mc Guire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180816162929.GA12967@osadl.at \
--to=der.herr@hofr.at \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).