473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

System call and library call

This is one of the interview question this morning, hope someone can
help out with this. Thanks.
What is the different between System call and library call?

May 3 '07 #1
6 2328
jg
On May 3, 3:32 pm, leoman730 <leoman...@gmail.comwrote:
What is the different between System call and library call?
A system call is a call to OS, whereas a library call is a call
to a library.

JG

May 3 '07 #2
leoman730 wrote:
This is one of the interview question this morning, hope someone can
help out with this. Thanks.
What is the different between System call and library call?
Here's another question. What's your C++ *language* question?

As to your first, try Google or Wikipedia.

May 3 '07 #3
On May 3, 6:32 pm, leoman730 <leoman...@gmail.comwrote:
This is one of the interview question this morning, hope someone can
help out with this. Thanks.
What is the different between System call and library call?
C++ doesn't know about a "system". It knows about an abstract machine,
though, and as such knows about volatile variables and I/O operations.
In that sense, you could call "something that has an effect on the
abstract machine" (i.e reading or writing a volatile variable or
performing an I/O operation) a "system call", whereas any other
function call could be coined "library call" assuming the function in
question is implemented in a library of some sort.
For one thing, as the effects of a program are defined in terms of
effects on the abstract machine, "system" calls as described above
cannot be optimized away whereas anything else could.

rlc

May 3 '07 #4

"leoman730" <le*******@gmail.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
This is one of the interview question this morning, hope someone can
help out with this. Thanks.
What is the different between System call and library call?
A system call is calling a function or API that interfaces with the
operating system.
A library call is calling a function or API that interfaces with a library.
The library itself may make system calls.
May 5 '07 #5
On May 5, 11:16 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
"leoman730" <leoman...@gmail.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
This is one of the interview question this morning, hope someone can
help out with this. Thanks.
What is the different between System call and library call?
A system call is calling a function or API that interfaces with the
operating system.
A library call is calling a function or API that interfaces with a library.
The library itself may make system calls.
As far as the application programmer is concerned, there is no
difference. He links against a "system library" (integrated
with the C runtime in libc under Unix, one of four or more
different variants under Windows). How that library achieves
what it achieves is really an implementation detail. On the
systems I've worked on, that actual system interface involved a
hardware level trap or interrupt, and couldn't be directly
called from C++; some of the functions in the "system library"
did nothing more than map the C++ (or C) calling sequence to
these conventions; others did more.

It's possible that something like that is what the interviewer
was looking for; that a system call went through some special
hardware mechanism, e.g. to change context, pass into system
mode, etc., where as other library calls don't. Then again,
it's possible that he was looking for something else. Unless
the job was for some sort of kernel level work, it's a worthless
question.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

May 6 '07 #6
"James Kanze" <ja*********@gmail.comwrote in message
news:11**********************@h2g2000hsg.googlegro ups.com...
On May 5, 11:16 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
"leoman730" <leoman...@gmail.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
This is one of the interview question this morning, hope someone can
help out with this. Thanks.
What is the different between System call and library call?
A system call is calling a function or API that interfaces with the
operating system.
A library call is calling a function or API that interfaces with a
library.
The library itself may make system calls.
As far as the application programmer is concerned, there is no
difference. He links against a "system library" (integrated
with the C runtime in libc under Unix, one of four or more
different variants under Windows). How that library achieves
what it achieves is really an implementation detail. On the
systems I've worked on, that actual system interface involved a
hardware level trap or interrupt, and couldn't be directly
called from C++; some of the functions in the "system library"
did nothing more than map the C++ (or C) calling sequence to
these conventions; others did more.

It's possible that something like that is what the interviewer
was looking for; that a system call went through some special
hardware mechanism, e.g. to change context, pass into system
mode, etc., where as other library calls don't. Then again,
it's possible that he was looking for something else. Unless
the job was for some sort of kernel level work, it's a worthless
question.

-------------

Which may of been exactly the answer the interviewer was looking for.
General computer/os/program/compiler knowledge.
May 6 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: nysfp | last post by:
Library call question: How to read block of data using Read ( unsigned char * Buf , unsigned long * BufSize ); ?? --
7
by: rahul8143 | last post by:
hello, what is difference between system call and library function call? Does library function call can have context switch to kernel mode? regards, rahul
1
by: Francois Vanderseypen | last post by:
I have a C-library to access a Tivoli LDAP directory. Thanks to this newsgroup I managed to find the correct DllImport (thanks everybody!), which is: public static extern int...
8
by: bob | last post by:
Which is faster - a call to a system function or a call to a library function?
21
by: omkar pangarkar | last post by:
Hi all, I have two simple hello world programs one using printf() and other using write() --prog 1-- #include<stdio.h> #include<stdlib.h> int main() { printf("Hello"); /* up to here...
1
by: sophia.agnes | last post by:
Dear all, I was going through peter van der linden's book expert C programming there i found the following:- Library call ------------ *call to a routine in a library *linked with user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.