System invoke action File--"Unix/linux Programming Practice Tutorial" reading notes

Source: Internet
Author: User

1. The WHO command reads the contents of the system log to display the user who is currently logged in.

2, Unix system to keep the data in the file, you can call the operation file through the following system:

Open (filename, how) creat (filename, mode) read (FD, buffer, AMT) write (FD, buffer, AMT) Lseek (FD, distance, base) Close (FD)



3, the process of the file read/write through the file descriptor, the file descriptor represents the connection between the file and the process.

4, each system call will cause user mode and kernel mode switching and execution of kernel code, so reduce the number of system calls in the program can increase the efficiency of the program operation.

5, the program can reduce the number of system calls by Buffering technology, only call the kernel service when the write buffer is full or the read buffer is empty.

6. The UNIX kernel can reduce the number of disk I/O accesses through kernel buffering.

7. The processing of time in UNIX is a description that is recorded from the beginning of a certain time.

8, when the system call error, the global variable errno is set to the corresponding error code, and then return-1, the program by checking the errno to determine the type of error, and take appropriate measures.


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.