Linux下常见的错误代码

用以下程序查看错误代码的含义:

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

int main()
{
    int i=0;
    for(i=0;i<43;i++)//43及以后就木有了
        printf("errno:%d:\t%s\n",i,strerror(i));
    return 0;
}

运行的结果是:

errno:0: No error
errno:1: Operation not permitted
errno:2: No such file or directory
errno:3: No such process
errno:4: Interrupted function call
errno:5: Input/output error
errno:6: No such device or address
errno:7: Arg list too long
errno:8: Exec format error
errno:9: Bad file descriptor
errno:10: No child processes
errno:11: Resource temporarily unavailable
errno:12: Not enough space
errno:13: Permission denied
errno:14: Bad address
errno:15: Unknown error
errno:16: Resource device
errno:17: File exists
errno:18: Improper link
errno:19: No such device
errno:20: Not a directory
errno:21: Is a directory
errno:22: Invalid argument
errno:23: Too many open files in system
errno:24: Too many open files
errno:25: Inappropriate I/O control operation
errno:26: Unknown error
errno:27: File too large
errno:28: No space left on device
errno:29: Invalid seek
errno:30: Read-only file system
errno:31: Too many links
errno:32: Broken pipe
errno:33: Domain error
errno:34: Result too large
errno:35: Unknown error
errno:36: Resource deadlock avoided
errno:37: Unknown error
errno:38: Filename too long
errno:39: No locks available
errno:40: Function not implemented
errno:41: Directory not empty
errno:42: Illegal byte sequence

posted @ 2019-12-11 23:29  castor_xu  阅读(621)  评论(0编辑  收藏  举报