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

Explain what is the advantage of a random access file?

0 Answers  


Define the scope of static variables.

0 Answers  


How can I prevent another program from modifying part of a file that I am modifying?

0 Answers  


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


Write the test cases for checking a variable having value in range -10.0 to +10.0?

0 Answers   Bosch,






How can you pass an array to a function by value?

0 Answers  


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

0 Answers  


what is the meaning of java that is (J A V A) full form of JAVA

71 Answers   AKS University, Bhel, BNL, BPO, HCL, Peacecon,


What is the time and space complexities of merge sort and when is it preferred over quick sort?

0 Answers   Amazon,


What does main () mean in c?

0 Answers  


write function to reverse char array ... without using second array

3 Answers  


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

0 Answers  


Categories