分类: LINUX
2011-05-12 17:17:18
Unix系统中文件的输入输出只需用5个函数即可:open,read,write,lseek,close。
本章讲的函数称为无缓冲I/O,(在第五章会讲标准的I/O). 无缓冲意味着每一次读或写都调用一个内核里面的系统调用。他们不属于是ISO C的内容,但是是POSIX.1里面的,也是Single Unix Specification里面的内容。
Whenever we describe the sharing of resources among multiple processes, the concept of an atomic operation becomes important. We examine this concept with regard to file I/O and the arguments to the open function. This leads to a discussion of how files are shared among multiple processes and the kernel data structures involved. After describing these features, we describe the dup, fcntl, sync, fsync, and ioctl functions.