Begining Linux Programing Chapter 3

/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.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值