Linux操作系统中错误码描述及其含义
点击次数:23 次 发布日期:2008-11-21 23:18:50 作者:源代码网
|
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 ", i, strerror(i)); } }
# ./a.out 执行,查看输出结果 源代码网供稿. |
