TLPI UNIX Linux System Programming Manual source code run __ block chain

Source: Internet
Author: User

At the end of last week, I began to read the book Unix/linux System Programming Manual, the weekend time to see the fourth chapter, that this book than directly to see the Linux kernel is better to accept more, because from the code to start, you can better understand, such as the third chapter of the system call to explain, if only theoretical aspects may be more boring, So the code in this book, How to run it. download Code

The homepage of this book. There are two code versions:
Distribution Version:a Tarball of the source code that is includes extra material not shown into the book. Probably, this is the version of the code that you want.
Book Version:a tarball of the "source code as it appears in the" book.
Can download according to their own choice, I downloaded the first version, you can click on the link above to download, if the download failed, you can go to the homepage to download.
Download the code, after decompression, as shown in the following figure:

Execute make in the Tlpi-dist directory, then go to each file under separate view, you can find that each. c file generates the corresponding executable file. There is a make file in each subfolder, and the role of make can be understood as we write. c files to compile, Because you want to include the author's error print header file, use GCC no longer like us before gcc-o hello hello.c so simple, to use include include header file, and makefile is simpler, each time the code has changed directly in the corresponding directory to execute make, will generate a new executable file.

We take the fourth chapter of a code as an example:

We run the program before the first new Hello, which is stored in the content, execution,/copy will see the corresponding usage, this is the author of the use of Usageerr printed out content, and then we follow the prompts to execute, verify, when the corresponding code, execute make again, will regenerate the executable file .
For the Variable Parameters section of chapter Three, please refer to my notes, if you have any questions and questions, welcome to talk with me
If make error after downloading code, do not generate the corresponding executable file, please upgrade the GCC version, refer to Segmentfault response

Related Article

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.