(standard c libraries translation )fileno

clearerr, feof, ferror, fileno - check and reset stream status
clearerr, feof, ferror, fileno - 检查和重置流状态

所需头文件
#include <stdio.h>
void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);

Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

fileno(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE

The function clearerr() clears the end-of-file and error indicators for the stream pointed to by stream.
clearerr清除流对应的eof和错误符

The function feof() tests the end-of-file indicator for the stream pointed to by stream, returning nonzero if it is set.  The end-of-file indicator can only be cleared by the function clearerr().
feof测试流的eof符,如果是eof则返回非0值,eof符只能使用clearerr清除

The function ferror() tests the error indicator for the stream pointed to by stream, returning nonzero if it is set.  The error indicator can  only  be reset by the clearerr() function.
ferror函数测试流的error符,如果是error符则返回非0值,error符只能通过clearerr重置

The function fileno() examines the argument stream and returns its integer descriptor.
fileno检测参数给定的流,返回整型的文件描述符

For nonlocking counterparts, see unlocked_stdio(3).
针对非阻塞的副本,可以查看unlocked_stdio

These  functions  should  not  fail  and  do  not set the external variable errno.  (However, in case fileno() detects that its argument is not a valid stream, it must return -1 and set errno to EBADF.)
这些函数不会有错误,所以没有设置内部的errno值
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值