免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1507 | 回复: 2
打印 上一主题 下一主题

perror("......")之外的错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-17 20:04 |只看该作者 |倒序浏览
我发现最近我使用perror()来报错时不时的出现 Illegal seek这个东西。
比如我检测

if(a<=0)
{
    perror("there is error\n");
}

当程序运行到这一句后的结果是:
there is error
Illegal seek


如果我将perror()注释掉,Illegal seek这句话就消失了。
Illegal seek这个东西本来不是我写进perror的,结果为什么会自动加一句呢??Illegal seek是从哪里来的。

谢谢各位

论坛徽章:
1
天蝎座
日期:2013-10-23 21:11:03
2 [报告]
发表于 2009-11-17 21:36 |只看该作者
APUE2
The perror function produces an error message on the standard error, based on the current value of errno, and returns.

#include <stdio.h>
void perror(const char *msg);

It outputs the string pointed to by msg, followed by a colon and a space, followed by the error message corresponding to the value of errno, followed by a newline.

论坛徽章:
0
3 [报告]
发表于 2009-11-18 10:30 |只看该作者

回复 #2 openspace 的帖子

恩。明白了。原来如此
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP