473,549 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2342
jg
On May 3, 3:32 pm, leoman730 <leoman...@gmai l.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...@gmai l.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*******@gmai l.comwrote in message
news:11******** *************@l 77g2000hsb.goog legroups.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...@rock etmail.comwrote :
"leoman730" <leoman...@gmai l.comwrote in message
news:11******** *************@l 77g2000hsb.goog legroups.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*********@gma il.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

May 6 '07 #6
"James Kanze" <ja*********@gm ail.comwrote in message
news:11******** **************@ h2g2000hsg.goog legroups.com...
On May 5, 11:16 pm, "Jim Langston" <tazmas...@rock etmail.comwrote :
"leoman730" <leoman...@gmai l.comwrote in message
news:11******** *************@l 77g2000hsb.goog legroups.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
1499
by: nysfp | last post by:
Library call question: How to read block of data using Read ( unsigned char * Buf , unsigned long * BufSize ); ?? --
7
6945
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
3118
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 InitializeRegistry(ref UIntPtr LDAPSession,string HostPort,string AdminUserID,string AdminPassword);
8
3190
by: bob | last post by:
Which is faster - a call to a system function or a call to a library function?
21
2433
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 write() isn't called, if u * give \n here then two write()s will
1
5946
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 program
0
7524
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5372
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.