20145235 "Information Security system design basics" No. 09 Week study summary _2

Source: Internet
Author: User

20145235 "Information Security system Design Fundamentals" No. 09 Week Study summary _1 Exercise 10.1

The first problem is usr/include inside no csapp.h and csapp.c downloaded a compressed package from the night, and to understand the pressure tar-xf Code.tar

Then put the inside of the Csapp.h and csapp.c into the usr/include inside.

Then compile and run c101.c. The descriptor return value is 3.

Code Hosting

Impressions and questions

I read the blog that people wrote that the most important thing is to let us understand the descriptor, when opening foo.txt, the descriptor pool of 0, 1, 2 has been used, Then open the Foo.txt, when the kernel returns a descriptor of 1, when the closing foo.txt is closed after the descriptor 3 into the description descriptors, when the Baz.txt is opened, the kernel returns a descriptor of 3, so the program result is 3.

So if you modify the code, do not close the foo.txt, but also the description of foo.txt print out, the results will be what? The results are as follows:

It is obvious that the descriptor is 4. Although the book does not explain the details, through this exercise is thoroughly understand what the descriptor is.

20145235 "Information Security system design basics" No. 09 Week study summary _2

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.