From mboxrd@z Thu Jan 1 00:00:00 1970 From: der.herr@hofr.at (Nicholas Mc Guire) Date: Thu, 16 Aug 2018 16:29:29 +0000 Subject: System call vs POSIX call In-Reply-To: References: Message-ID: <20180816162929.GA12967@osadl.at> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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