what is the difference between. system call and library
function?

Answers were Sorted based on User's Feedback



what is the difference between. system call and library function?..

Answer / vishnu948923

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.

Is This Answer Correct ?    66 Yes 9 No

what is the difference between. system call and library function?..

Answer / eng abedalmohdi almomani

system call can be called from either kernel space or user
space(in this case include switch to privilage mode) and
executed in kernel space while library called only from
user programm and may call systemcall to perform it is
function like "printf" that need "write" system call while
other not need kernel at all like sin(),cos().....

systemcall examples : write,read,close,mmap,open,.......
library examples: fopen,fclose,printf,scanf,fscanf,.....

Is This Answer Correct ?    38 Yes 8 No

Post New Answer

More C Interview Questions

What is the explanation for modular programming?

0 Answers  


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

0 Answers   Wipro,


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

0 Answers  


# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none

7 Answers   Microsoft, TCS,


In C programming, how do you insert quote characters (‘ and “) into the output screen?

0 Answers  






write a program of palindrome(madam=madam) using pointer?

5 Answers   L&T,


write an algorithm to display a square matrix.

0 Answers  


What is this infamous null pointer, anyway?

0 Answers  


Explain what is page thrashing?

0 Answers  


Is it possible to have a function as a parameter in another function?

0 Answers  


how many argument we can pas in in a function

25 Answers   CTS,


WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c file management?

28 Answers   3D PLM, Code Studio, Deltech, IBM,


Categories