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 1f in c?

0 Answers  


what is function pointer?

2 Answers   Wipro,


what is a far pointer

12 Answers   ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,


What is static and auto variables in c?

0 Answers  


What is a c token and types of c tokens?

0 Answers  






A set of N billiard balls are set on a one-dimensional table. The table is 1 meter long, set north-south with two pockets at either side. Each ball has zero width and there is no friction so it is moving with a fixed velocity of either northward or southward and bounces back in a perfect elastic collision from other balls it encounter on its way (or drop into one of the pockets). Your job is to keep track of the balls movements. Task Please write a program that gets the initial place, speed and direction of all the balls and gives the position of a specific ball after t seconds. Input The first line contains the number of scenarios. Each one of the other lines in the input contains a scenario: The first number, N, is the number of balls; followed by N pairs of numbers: the distance in centimeters from the south end of the table and the speed (positive speed meaning it moves northward); the last two numbers are the number i of the target ball you should track and the time T in seconds. Output The output is a single number for each line which is the place (distance in centimeters from the south end of the table) of the tracked ball after T seconds. Note: There is no new line character at the end of the result. Sample Input 5 1 50 1 1 1000 1 50 1 1 6 1 60 -2 1 6 2 10 1 95 -1 2 30 2 10 1 95 -1 2 60 Sample Output 100 56 48 65 70

0 Answers  


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

0 Answers  


What's the best way of making my program efficient?

0 Answers   Celstream,


difference between c and c++

3 Answers  


What is the size of empty structure in c?

0 Answers  


What is output of the following program ? main() { i = 1; printf("%d %d %d\n",i,i++,i++); }

9 Answers   CTS, Wipro,


main() { int a=5; printf(?%d,%d,%d\n?,a,a< <2,a>>2); } Answer: 5,20,1 please explain this code in detail

6 Answers   TCS,


Categories