您现在的位置: 电脑知识网 >> 电脑系统 >> Linux FreeBSD >> 正文

ux操作系统中错误码描述及其含义

 日期:2008-2-28 7:29:36 作者: 您有问题?请联系我们 繁體中文

1. 简单明了,一个命令,想看什么看什么:

# perror

如# perror 0 表示Success, #perror 1表示Operation not permitted

2. 直接看C文件里的定义:

# more /usr/include/asm-generic/errno-base.h (基本错误,从0到34)

# more /usr/include/asm-generic/errno.h (扩展错误,从35到131)

3. 写个C程序来瞧瞧:

# vi errorlist.c

#include<stdio.h>

#include<errno.h>

#include<string.h>

int main()

{

int i;

for (i=0; i<257; i++)

{



printf("Error # %d: %s\n", i, strerror(i));

}

}

# gcc errorlist.c 编译该C文件

# ./a.out 执行,查看输出结果

更多内容请看 电脑知识商网 > > 电脑系统 > > Linux FreeBSD专题


  • 上一个文章:

  • 下一个文章:
  • Pc235免费的教育教学网络资源
    【频道更新】
    【相关推荐】
    电脑知识商网 版权所有 严禁转载本站文章 违者追究法律责任
    copyright © 2007 www.shenmeshi.org.cn online services. all rights reserved. ICP备案:渝ICP备07500547号