Information Security system design basics Eighth Week study notes

Source: Internet
Author: User

System-Level I/O

The input/output is the process of copying data between main memory and external devices such as disk drives, terminals, and networks. The input operation copies data from the I/O device to main memory, while the output operation copies data from main memory to the I/O device.

10.1 Unix I/O

A UNIX file is a sequence of M bytes: b0,b1,b2,b3 ... Bk... Bm-1.

All I/O devices, such as networks, disk box terminals, are modeled as files, and all inputs and outputs are executed as read and write to the corresponding file. This is an application interface that becomes UNIX I/O.

① Open File: An application declares that it wants to access an I/O device by requiring the kernel to open the appropriate file. The kernel returns a small, non-negative integer called a descriptor. It identifies this file in all subsequent operations on this file. The kernel logs all information about this open file. The application only needs to remember this identifier.

There are three open files at the beginning of each process of the UNIX shell: standard input (descriptor 0), standard output (descriptor 1), standard error (descriptor 2). Header file <unistd.h> defines constants Stdin_fileno, Stdout_fileno, Stderr_fileno, which are used instead of explicit descriptor values.

② changes the current file location. For each open file, the kernel maintains a file location K, which is initially 0. This file location is from

Information Security system design basics Eighth Week study notes

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.