TAILIEUCHUNG - Advanced Linux Programming: 8-Linux System Calls

Tham khảo tài liệu 'advanced linux programming: 8-linux system calls', công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Linux System Calls S O FAR WE VE PRESENTED A VARIETY OF FUNCTIONS that your program can invoke to perform system-related functions such as parsing command-line options manipulating processes and mapping memory. If you look under the hood you ll find that these functions fall into two categories based on how they are implemented. A library function is an ordinary function that resides in a library external to your program. Most of the library functions we ve presented so far are in the standard C library libc. For example getopt_long and rnksternp are functions provided in the C library. A call to a library function is just like any other function arguments are placed in processor registers or onto the stack and execution is transferred to the start of the function s code which typically resides in a loaded shared library. A system call is implemented in the Linux a program makes a system call the arguments are packaged up and handed to the kernel which takes over execution of the program until the call completes. A system call isn t an ordinary function call and a special procedure is required to transfer control to the kernel. However the GNU C library the implementation of the standard C library provided with GNU Linux systems wraps Linux system calls with functions so that you can call them easily. Low-level I O functions such as open and read are examples of system calls on Linux. 168 Chapter 8 Linux System Calls The set of Linux system calls forms the most basic interface between programs and the Linux kernel. Each call presents a basic operation or capability. Some system calls are very powerful and can exert great influence on the system. For instance some system calls enable you to shut down the Linux system or to allocate system resources and prevent other users from accessing them. These calls have the restriction that only processes running with superuser privilege programs run by the root account can invoke them. These calls fail if

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.