Begining Linux Programing Chapter 3
2012-10-11 10:04
253 查看
/dev/console
Error messages and diagnostics are often sent to this device.
/dev/tty
It is an alias for the controlling terminal of a process.
/dev/null
All output written to this device is discarded.
Library Functions:
The library functions arrange for the low-level system calls .
Permission:
The mode value given in the open call is ANDed with the inverse of the user mask value at runtime.
ioctl:
It provides an interface for controlling the behavior of devices and their descriptors and configuring underlying services.
The standard I/O library:
The equivalent of the low-level file descriptor is called a stream is implemnted as a pointer to a structure, a FILE *.
Three file streams are automatically opened when a program is strarted.They are stdin,stdout,stderr.
fclose:
To close the specified stream,causing any unwritten data to be fgwritten.When a program ends normally,fclose is called automatically on all file streams that are still open.
fflush:
causing all outstanding data on a file stream to be written immediately. f
fgets:
read a string from an input file stream.
Streams Error:
The ferror function tests the error indicator for a stream and returns nonzero if it's set,but zero otherwise.
The feof function tests the end-of-file indicator within a stream and returns nonzero if it is set,zero otherwise.
The clearerr function clears the end-of-file and error indicators for the stream to which stream points.
Error:
strerror,maps an error number into a string describing the type of error that has occurred.
perror,report in errno,into a string and prints it on the standard error stream.
Error messages and diagnostics are often sent to this device.
/dev/tty
It is an alias for the controlling terminal of a process.
/dev/null
All output written to this device is discarded.
Library Functions:
The library functions arrange for the low-level system calls .
Permission:
The mode value given in the open call is ANDed with the inverse of the user mask value at runtime.
ioctl:
It provides an interface for controlling the behavior of devices and their descriptors and configuring underlying services.
The standard I/O library:
The equivalent of the low-level file descriptor is called a stream is implemnted as a pointer to a structure, a FILE *.
Three file streams are automatically opened when a program is strarted.They are stdin,stdout,stderr.
fclose:
To close the specified stream,causing any unwritten data to be fgwritten.When a program ends normally,fclose is called automatically on all file streams that are still open.
fflush:
causing all outstanding data on a file stream to be written immediately. f
fgets:
read a string from an input file stream.
Streams Error:
The ferror function tests the error indicator for a stream and returns nonzero if it's set,but zero otherwise.
The feof function tests the end-of-file indicator within a stream and returns nonzero if it is set,zero otherwise.
The clearerr function clears the end-of-file and error indicators for the stream to which stream points.
Error:
strerror,maps an error number into a string describing the type of error that has occurred.
perror,report in errno,into a string and prints it on the standard error stream.
相关文章推荐
- Begining Linux Programing Chapter 1,2
- 《linux 内核全然剖析》 chapter 2 微型计算机组成结构
- Chapter 7 Linux文件与目录管理——习题
- Beginning Linux Programming 4th Edition 学习笔记 - Chapter 1:Getting started
- 《Understanding the Linux kernel》学习笔记 Chapter 13: I/O Architecture and Device Drivers
- Linux Programing -- ch14-- 信号量、共享内存、消息队列
- 读书笔记《Building embedded linux system》Chapter 7 存贮设备操作
- Programming and Using Linux Sound - in depth - Chapter 5 ALSA
- 读书笔记-深入linux内核架构-Chapter 1
- Linux C Programing - Terminal(1)
- 《linux 内核完全剖析》 chapter 5 Linux内核体系结构
- 《Understanding the Linux kernel》学习笔记 Chapter 12: The Virtual Filesystem
- 读书笔记-深入linux内核架构-Chapter 2 - part2
- chapter14:Linux帐号管理之(1)身份切换
- intro-linux chapter 2
- 读书笔记《Building embedded linux system》Chapter 6 根文件系统内容
- Chapter 5: PS1, PS2, PS3, PS4 and PROMPT_COMMAND __Linux 101 Hacks
- First step to Signal —— in Linux C Programing
- [linux device driver] Chapter 03:scullc_open理解
- begining-command-line 的学习笔记 ——Chapter 2 unit1 change your password