《Unix高级环境编程》 读书笔记(1)(ch0~ch2)

本书详细介绍了Unix系统编程接口,包括系统调用和标准C库功能。第一章概述了Unix系统服务,如登录、文件、目录、输入输出、进程控制和错误处理。第二章讨论Unix标准化和实现,涵盖ISO C、IEEE POSIX和单一UNIX规范。书中通过实例解释了编程概念,并提供了约10000行C代码。
摘要由CSDN通过智能技术生成

《Unix高级环境编程》 读书笔记
<Advanced Programming in the Unix Environment> Reading Notes

(使用的是2005年的英文第二版,

   英文第三版已经在2013年五月发行,主要是根据新的标准进行了修正。主要的变化是将书中一些已经过时的接口(与STREAM相关的接口,因为这些接口在新的标准里被废除了),与Linux相关的最大变化是由于内核平台由第二版的2.4变为最新的3.2,所以在Thread相关的内容上进行了重新的改写。据此我们在看书时涉及相关方面时需要注意,如也可以看看新的关于thread的章节:

"One of the essential classics of UNIX programming."

—Eric S. Raymond, author of The Art of UNIX Programming


Forward by Dennis Ritchie:..."It's a most worthy second edition of a classic."...


0.Preface

   主要是简要的介绍了一下Unix以及本书的写作背景与历史,介绍了本书的基本内容。

   “This book describes theprogramming interface to the Unix system, thesystem call interface and many of the functions provided in thestandard C library. It is intended for anyone writing programs that run under Unix.”

    Organization of the book:

    1,  Overview & introduction:         ch1;

        Unix Standardization:                ch2;

    2,  I/O, files, I/O library:                ch3~6;

    3,  processes, signals:                    ch7~10;

    4,  I/O terminal,advanced I/O:        ch11~13;

    5, IPC:                                         ch14~15;

    6, examples:                                  ch16~19.

    "This text is intended for programmers familiar with Unix and programmers familiar with some other operating system who wish to learn the details of the services provided by most Unix systems."

    本书中的所有近10000行代码都是用C写的。

                      Chapter 1. UNIX System Overview

1.1 Intro

     The focus of this text is to describe the services provided by various versions of the UNIX operating system.

1.2 Architecture

    

  In a strict sense, an operating system can be defined as the software that controls the hardware resources of the computer and provides an environment under which programs can run.

   The interface to the kernel is a layer of software called thesystem calls (the shaded portion inFigure 1.1). Libraries of common functions are built on top of the system call interface, but applications are free to use both. The shell is a special application that provides an interface for running other applications.

1.3 Logging in

   When we log in to a UNIX system, we enter our login name, followed by our password. The system then looks up our login name in its password file, usually the file/etc/passwd.

   Shells:  Ashell is a command-line interpreter that reads user input and executes commands. The user input to a shell is normally from the terminal (an interactive shell) or sometimes from a file (called ashell script). 

1.4 Files and Directories

 File System:

   A directory is a file that contains directory entries. Logically, we can think of each directory entry as containing a filename along with a structure of information describing the attributes of the file.

 Filename & Pathname

  The names in a directory are calledfilenames. The only two characters that cannot appear in a filename are the slash character (/) and the null character. 

    A sequence of one or more filenames, separated by slashes and optionally starting with a slash, forms apathname. A pathname that begins with a slash is called anabsolute pathname; otherwise, it's called arelative pathname.

  Working directory & Home directory:This is the directory from which all relati

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值