Differences and connections between basic UNIX knowledge and system calls and library functions

Source: Internet
Author: User

The details are as follows:

All operating systems provide entry points for multiple services, and the program requests services from the kernel. UNIX implementations of various versions provide clear definitions, a limited number of entry points that can directly enter the kernel. These entry points are called system calls.

System Call interfaces are always described in section 2nd of the UNIX programmer manual. Section 3rd defines general functions that can be used by programmers. Although these functions may call one or more kernel system calls, they are not the kernel entry points.

The technology used by UNIX is to set a function with the same name in the Standard C library for each system call.

From the perspective of the implementer, there is a major difference between system calls and library functions. However, from the user perspective, the difference is not very important. Both system calls and library functions are in the form of C functions, both of which provide services for applications. However, we should understand that, if necessary, we can replace library functions, but generally cannot replace system calls.

Applications can call system calls or library functions, while many library functions call system calls.

Another difference between system calls and library functions is that system calls usually provide a minimum interface, while library functions usually provide more complex functions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.