Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Systems /Difference Between System Call and Function Call

Difference Between System Call and Function Call

2011年6月27日Posted byIndika

System Call vs Function Call

A typical processor executes instructions one by one. But there may be occasions where the processor has to stop current instruction and execute some other program or code segment (residing in some other place). After doing this the processor returns to normal execution and continues from where it left off. A system call and a function call are such occasions. A system call is a call to a subroutine built in to the system. A function call is a call to a subroutine within the program itself.

What is a System Call?

System calls provide programs running on the computer an interface to talk with the operating system. When a program needs to ask for a service (for which it does not have permission to do that by itself) from the kernel of the operating system, it uses a system call. User level processes do not have the same permissions as the processes directly interacting with the operating system. For example, to communicate with and external I/O device or to interact with any other processes, a program uses system calls.

What is a Function Call?

A function call is also called a subroutine call. A subroutine (also known as a procedure, function, method or routine) is part of a larger program that is responsible for carrying out a specific task. The larger program may execute a heavy workload, and the subroutine may be performing just a simple task, which is also independent of the remaining program coding. A function is coded in such a way that it may be called multiple times and from different places (even from within other functions). When a function is called, the processor may go to where the code for the function is residing and execute the instructions of the function one by one. After completing the functions, the processor will return to exactly where it left off and continue the execution starting from the next instruction. Functions are a great tool for code reuse. Many modern programming languages support functions. A collection of functions is called a library. Libraries are often used as means of sharing and trading software. In some cases, the whole program could be a sequence of subroutines (e.g. threaded code compilation).

What is the difference between System Call and Function Call?

System call is a call to a subroutine built in to the system, while a function call is a call to a subroutine within the program. Unlike function calls, system calls are used when a program needs to perform some task, which it does not have privilege for. System calls are entry points in to the operating system kernel and are not linked to the program (like function calls). Unlike, system calls, function calls are portable. Time overhead of a system call is more than the overhead for a function call because a transition between the user mode and the kernel mode must take place. System calls are executed in kernel address space, while function calls are executed in user address space.

Related posts:

Difference Between Procedures and Functions in Programming Difference Between Internal Hard Drive and External Hard Drive Difference Between CMOS and BIOS Difference between Hardware and Software 物理和虚拟内存之间的差异

Filed Under:SystemsTagged With:execution,Function,function call,操作说明,核心,核心mode,library,operating system,Processor,subroutine,子例程呼叫,system call,user mode

About the Author:Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Comments

  1. manzoor hussainsays

    November 6, 2019 at 9:20 am

    谢谢先生,它helpmed我很多。坚持下去你r nice job and sharing knowledge.
    Bless you.

    回复

发表评论Cancel reply

Your email address will not be published.Required fields are marked*

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

冠状病毒和流感的差异

冠状病毒和流感的差异

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Samsung Galaxy M pro and Y Pro

What is the Difference Between DNA Profiling and Genetic Screening

What is the Difference Between DNA Profiling and Genetic Screening

Difference Between DBMS and File System

Difference Between AC Capacitor and DC Capacitor

Difference Between Weighted and Unweighted GPA

Latest Posts

  • What is the Difference Between Graphite and Lead
  • What is the Difference Between Symptom and Syndrome
  • What is the Difference Between Platelet Plug and Blood Clot
  • 凝集和血凝之间有什么区别
  • What is the Difference Between Fullerene and Carbon Nanotubes
  • What is the Difference Between Dialysis and Kidney Transplant
  • Home
  • Vacancies
  • About
  • Request Article
  • 联系我们

Copyright © 2010-2018Difference Between. All rights reserved.Terms of Use和隐私政策:Legal.