[Second edition of advanced programming in UNIX environment] Reading Notes 1 ~ Chapter 2

Source: Internet
Author: User

1.1 null
1.2 kernel interface = system call. Kernel + software (System Utility, application software, Shell, public function library) = operating system.
1.3 password file/etc/passwd
SAR: X: 205: 105: Stephen Rago:/home/SAR:/bin/KSh
Login Name, encrypted password, user ID (205), group ID (105), comment, start directory (/home/SAR), shell program (/bin/KSh ).

Shell: Command Line interpreter. In Linux, the default value is Bourne-again. Mac OS default tenex C.
1.4 file system. Root directory /. Stat and fstat get all attributes of the file.
Point, the current directory. Point, parent directory. (Except for the root directory)
Relative Path, absolute path. Ls program. MAN 1 ls.
Each process has a working directory.
Start directory (home ).
The 1.5 file descriptor is a small non-negative number.
Each time a new program is run, all the shells open three file descriptors for it: stdin_fileno, stdout_fileno, and stderr_fileno. Targeting a file ls> file. List
No buffer I/O required.
Standard I/O provides a buffer-free interface for I/O functions.
1.6 programs. Six exec, the kernel reads the program into the memory and executes it.
Getpid ();
Control Process fork, exec, waitpid.
Generally, a process has only one control thread. Multiple Control threads must be mutually exclusive.
1.7 error handling:
Char * strerror (INT errnum );
Void perror (const char * s );
1.8 Super User Root, user id = 0. Getuid ();
Group ID. Resources are shared among all members of the same group. Getgid (); Use Id to store only 2 bytes, so no string is needed.
Additional group ID, which will be read in/etc/group upon login.
1.9 interrupt key (SIGINT signal will be sent) delete or Ctrl + C. Return key (usually Ctrl + \).
1.10 The number of seconds that UTC has experienced since 00:00:00, January 1, January 1, 1970.
Clock time: the total number of processes running. The value is related to the number of processes running simultaneously in the system.
User CPU time: the time used to execute USER commands.
The system CPU time is the time when the kernel program lock is executed for the process. User + system CPU time = CPU time.
1.11 null
1.12 null
Bytes ------------------------------------------------------------------------------------------------
2.1 null
2.2 Iso c 1990, then updated to 1999. According to the standard headers, the iso c library is divided into 24 zones.
Ieee posix.
Single UNIX specification.
FIPS, Federal Information Processing standard.
2.3 svr4, UNIX System V Release 4, at&t's UNIX System Lab product.
4.4bsd, UC Berkeley.
FreeBSD, based on 4.4bsd-lite.
Linux, Linus Torvalds was developed in 1991 to replace Minix.
Mac OS X uses completely different technologies. The core is Darwin, which is based on the Mach kernel.
Solaris, based on svr4, was enhanced by Sun over 10 years.
2.4 null
2.5 compile the time limit (what is the short maximum value ?), Running time limit (How many characters can a file name contain ?).
Solution: 1) Compile the time limit (header file ). (Your own idea: iso c is of this type, so you only need to pay attention to the header. Others are too complicated and ignored directly .)
2) does not associate with files or directories ).
3) and 2) (pathconf and fpathconf functions ).
Get the running time limit value: # include <unistd. h>
Long sysconf (INT name );
Long pathconf (const char * pathname, int name );
Long fpathconf (INT filedes, int name );
2.7 null
2.8 many data types are defined in the header file <sys/types. h> using typedef.
2.9 null
2.10 null

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.