[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


what's the difference between system call and functions?

<< Back to: Unix - Frequently Asked Questions (Contents) [Frequent posting]

Question by murugaiyan
Submitted on 2/4/2004
Related FAQ: Unix - Frequently Asked Questions (Contents) [Frequent posting]
Rating: Rate this question: Vote
what's the difference between system call and functions?


Answer by vijay
Submitted on 3/5/2004
Rating:  Rate this answer: Vote
system call is a subroutine which internally interacts with the kernel which is operated by the os.
Function is a sub program which is going to return a value

 

Answer by vasunthra
Submitted on 5/25/2004
Rating:  Rate this answer: Vote
   system calls are provided by the system and are executed in the system kernel. They are entry points into the kernel and are therefore NOT linked into your program. These are not portable calls.
·   Library calls include the ANSI C standard library and are therefore portable. These functions are linked into your program.
It is worth noting that, because system calls are part of the O/S. The program has to make a context switch to the kernel when they are called and because of this, they have a high startup overhead. The upside is that the time executing these routines is assigned to the OS and not the user program.

 

Answer by Tammannappa Mannikeri
Submitted on 7/17/2004
Rating:  Rate this answer: Vote
System call provides the interface between process and kernel.

 

Answer by Sunil
Submitted on 8/28/2004
Rating: Not yet rated Rate this answer: Vote
system call is a service provided by os to the user process.
time overhead in calling the system call stince a transition has to take place between user mode and kernel mode.which is not required in case of function call.
system call deffer from one OS to the other they are system dependent whereas the function calls are not.

 

Answer by Chandan Dung
Submitted on 11/2/2004
Rating: Not yet rated Rate this answer: Vote
system calls are executed in  kernel address space,while library routines are executed in user address space.
for the execution of system call system has to go in previelege mode(supervisior mode).
in that mode it can acess any critical data or hardware resourse.
system calls are supported by OS , so portability is a great point of discussion for difference between system call and library routine.
in C we have fopen()- to open a file is a library routine.
while open() is a system call.
and i think fopen() also use open() in its code.

 

Answer by Richard
Submitted on 12/10/2004
Rating: Not yet rated Rate this answer: Vote
System calls are much safer than library functions because there is security vulnerability are lower in system calls than library functions

 

Answer by Dereje Getaneh
Submitted on 2/18/2005
Rating: Not yet rated Rate this answer: Vote
System Call is a method used by a process to request action by the operating system.
A function is a subroutine and mostly part of a user program which may or may not return a value to the calling function.

 

Answer by saumitra
Submitted on 2/24/2005
Rating: Not yet rated Rate this answer: Vote
System calls are functions that transfer control from the user process to the operating system kernel. Functions such as read() and write() are system calls.
Library functions typically provide a richer set of features. For example, the fread() library function reads a number of elements of data of specified size from a file. While presenting this formatted data to the user, internally it will call the read() system call to actually read data from the file.

 

Answer by saurabh mukherjee
Submitted on 5/19/2005
Rating: Not yet rated Rate this answer: Vote
System calls are the operating systems routine used internally to interact in low level, While funtions are generally used to return the values required by the user at user level.

 

Answer by Jyothi
Submitted on 5/27/2005
Rating: Not yet rated Rate this answer: Vote
system call is a subroutine which internally interacts with the kernel which is operated by the os.
Function is a sub program which is going to return a value
system calls are provided by the system and are executed in the system kernel. They are entry points into the kernel and are therefore NOT linked into your program. These are not portable calls.
·   Library calls include the ANSI C standard library and are therefore portable. These functions are linked into your program.
It is worth noting that, because system calls are part of the O/S. The program has to make a context switch to the kernel when they are called and because of this, they have a high startup overhead. The upside is that the time executing these routines is assigned to the OS and not the user program.
System call provides the interface between process and kernel.

 

Answer by Rahul Vats
Submitted on 6/2/2005
Rating: Not yet rated Rate this answer: Vote
System Calls are the call made by the Operating system to interact with the Hardware.
Functions are the user defined or pre-defined code that consist of some statements or instructions to be executed.

 

Answer by Dillip Rout
Submitted on 6/27/2005
Rating: Not yet rated Rate this answer: Vote
When you invoke a system call from your user code, say from function foo () in your program, you are actually invoking a routine in the kernel. This causes what is known as a context switch from "user space" to "kernel space," although that's just for you information. In terms of the way it is called, there is no difference between a system call and a library function. A C library function is not in itself a part of the OS code. It essentially runs in user space, but part of its implementation may run in kernel space. See the next point.

 

Answer by sree
Submitted on 7/9/2005
Rating: Not yet rated Rate this answer: Vote
system calls are executing in kernel mode,
functions are executing in user mode.

 

Answer by gogo
Submitted on 12/29/2005
Rating: Not yet rated Rate this answer: Vote
ddddddd

 

Answer by Mohammad shamim
Submitted on 1/25/2006
Rating: Not yet rated Rate this answer: Vote
System calls are predefined functions in the kernel space while libraries are predefined functions in the user space.
When any process makes a system call then it operation switch from user space to kernel space and there it perform its operation, but this switching takes more time , so it is beneficial to use less number of system calls.

 

Answer by M.Rekha
Submitted on 5/22/2006
Rating: Not yet rated Rate this answer: Vote
1)System calls are part of operating system
whereas libray functions are part of application software.
2) system calls cannot be modified but library functions can be modified.
Whenever a program requires system resources, a system call is initiated.

 

Answer by sathiya
Submitted on 9/8/2006
Rating: Not yet rated Rate this answer: Vote
System call work in the kernel space,
Library function will work in the user space

 

Answer by ahmad
Submitted on 9/21/2006
Rating: Not yet rated Rate this answer: Vote
sytem call is handled by the kernel directly & these are already defined whereas functions are created by the user & a call from the function invokes it.

 

Answer by rajesh_bhabutkar
Submitted on 10/11/2006
Rating: Not yet rated Rate this answer: Vote
System call is a function which is used to communicate with kernel.

 

Answer by srinivas reddy.b
Submitted on 1/25/2007
Rating: Not yet rated Rate this answer: Vote
“System Call” can be defined as the means through which the User programs can access the Kernel services.

Function is a sub program which is going to return a value

 

Answer by surender Bishnoi
Submitted on 2/10/2007
Rating: Not yet rated Rate this answer: Vote
System calls are system dependent and are particular machine instructions used to controle the access of hardware resourses like memory mgt. System call invoke OS routine to have service and this happen only in system mode.

Function on the other hand may be user application related or specific routine written in OS to do a particular task. While invoking function call we do not need to change mode of operation.

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Unix - Frequently Asked Questions (Contents) [Frequent posting]


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.