精华内容
下载资源
问答
  • linux错误码分析

    千次阅读 2013-11-22 17:06:20
    22:参数错误,比如ip地址不合法...115:当链接设置为非阻塞时,目标没有及时应答,返回错误,socket可以继续使用   附录:Linux错误码表(errno table) _ 124 EMEDIUMTYPE_ Wrong medium type _ 123 ENOMEDIUM__

    22:参数错误,比如ip地址不合法,没有目标端口等

    101:网络不可达,比如不能ping通

    111:链接被拒绝,比如目标关闭链接等

    115:当链接设置为非阻塞时,目标没有及时应答,返回此错误,socket可以继续使用

     

    附录:Linux的错误码表(errno table)

    _ 124 EMEDIUMTYPE_ Wrong medium type
    _ 123 ENOMEDIUM__ No medium found
    _ 122 EDQUOT___  Disk quota exceeded
    _ 121 EREMOTEIO__ Remote I/O error
    _ 120 EISNAM___  Is a named type file
    _ 119 ENAVAIL___ No XENIX semaphores available
    _ 118 ENOTNAM___ Not a XENIX named type file
    _ 117 EUCLEAN___ Structure needs cleaning
    _ 116 ESTALE___  Stale NFS file handle
    _ 115 EINPROGRESS  +Operation now in progress
    _ 114 EALREADY__  Operation already in progress
    _ 113 EHOSTUNREACH  No route to host
    _ 112 EHOSTDOWN__ Host is down
    _ 111 ECONNREFUSED  Connection refused
    _ 110 ETIMEDOUT_  +Connection timed out
    _ 109 ETOOMANYREFS  Too many references: cannot splice
    _ 108 ESHUTDOWN__ Cannot send after transport endpoint shutdown
    _ 107 ENOTCONN__  Transport endpoint is not connected
    _ 106 EISCONN___ Transport endpoint is already connected
    _ 105 ENOBUFS___ No buffer space available
    _ 104 ECONNRESET_  Connection reset by peer
    _ 103 ECONNABORTED  Software caused connection abort
    _ 102 ENETRESET__ Network dropped connection on reset
    _ 101 ENETUNREACH_ Network is unreachable
    _ 100 ENETDOWN__  Network is down
    _  99 EADDRNOTAVAIL Cannot assign requested address
    _  98 EADDRINUSE_  Address already in use
    _  97 EAFNOSUPPORT  Address family not supported by protocol
    _  96 EPFNOSUPPORT  Protocol family not supported
    _  95 EOPNOTSUPP_  Operation not supported
    _  94 ESOCKTNOSUPPORT Socket type not supported
    _  93 EPROTONOSUPPORT Protocol not supported
    _  92 ENOPROTOOPT_ Protocol not available
    _  91 EPROTOTYPE_  Protocol wrong type for socket
    _  90 EMSGSIZE__ +Message too long
    _  89 EDESTADDRREQ  Destination address required
    _  88 ENOTSOCK__  Socket operation on non-socket
    _  87 EUSERS___  Too many users
    _  86 ESTRPIPE__  Streams pipe error
    _  85 ERESTART__  Interrupted system call should be restarted
    _  84 EILSEQ___  Invalid or incomplete multibyte or wide character
    _  83 ELIBEXEC__  Cannot exec a shared library directly
    _  82 ELIBMAX___ Attempting to link in too many shared libraries
    _  81 ELIBSCN___ .lib section in a.out corrupted
    _  80 ELIBBAD___ Accessing a corrupted shared library
    _  79 ELIBACC___ Can not access a needed shared library
    _  78 EREMCHG___ Remote address changed
    _  77 EBADFD___  File descriptor in bad state
    _  76 ENOTUNIQ__  Name not unique on network
    _  75 EOVERFLOW__ Value too large for defined data type
    _  74 EBADMSG__  +Bad message
    _  73 EDOTDOT___ RFS specific error
    _  72 EMULTIHOP__ Multihop attempted
    _  71 EPROTO___  Protocol error
    _  70 ECOMM____ Communication error on send
    _  69 ESRMNT___  Srmount error
    _  68 EADV____  Advertise error
    _  67 ENOLINK___ Link has been severed
    _  66 EREMOTE___ Object is remote
    _  65 ENOPKG___  Package not installed
    _  64 ENONET___  Machine is not on the network
    _  63 ENOSR____ Out of streams resources
    _  62 ETIME____ Timer expired
    _  61 ENODATA___ No data available
    _  60 ENOSTR___  Device not a stream
    _  59 EBFONT___  Bad font file format
    _  57 EBADSLT___ Invalid slot
    _  56 EBADRQC___ Invalid request code
    _  55 ENOANO___  No anode
    _  54 EXFULL___  Exchange full
    _  53 EBADR____ Invalid request descriptor
    _  52 EBADE____ Invalid exchange
    _  51 EL2HLT___  Level 2 halted
    _  50 ENOCSI___  No CSI structure available
    _  49 EUNATCH___ Protocol driver not attached
    _  48 ELNRNG___  Link number out of range
    _  47 EL3RST___  Level 3 reset
    _  46 EL3HLT___  Level 3 halted
    _  45 EL2NSYNC__  Level 2 not synchronized
    _  44 ECHRNG___  Channel number out of range
    _  43 EIDRM____ Identifier removed
    _  42 ENOMSG___  No message of desired type
    _  40 ELOOP____ Too many levels of symbolic links
    _  39 ENOTEMPTY_  +Directory not empty
    _  38 ENOSYS___ +Function not implemented
    _  37 ENOLCK___ +No locks available
    _  36 ENAMETOOLONG +File name too long
    _  35 EDEADLK__  +Resource deadlock avoided
    _  34 ERANGE___ +Numerical result out of range
    _  33 EDOM____ +Numerical argument out of domain
    _  32 EPIPE___  +Broken pipe
    _  31 EMLINK___ +Too many links
    _  30 EROFS___  +Read-only file system
    _  29 ESPIPE___ +Illegal seek
    _  28 ENOSPC___ +No space left on device
    _  27 EFBIG___  +File too large
    _  26 ETXTBSY___ Text file busy
    _  25 ENOTTY___ +Inappropriate ioctl for device
    _  24 EMFILE___ +Too many open files
    _  23 ENFILE___ +Too many open files in system
    _  22 EINVAL___ +Invalid argument
    _  21 EISDIR___ +Is a directory
    _  20 ENOTDIR__  +Not a directory
    _  19 ENODEV___ +No such device
    _  18 EXDEV___  +Invalid cross-device link
    _  17 EEXIST___ +File exists
    _  16 EBUSY___  +Device or resource busy
    _  15 ENOTBLK___ Block device required
    _  14 EFAULT___ +Bad address
    _  13 EACCES___ +Permission denied
    _  12 ENOMEM___ +Cannot allocate memory
    _  11 EAGAIN___ +Resource temporarily unavailable
    _  10 ECHILD___ +No child processes
    __ 9 EBADF___  +Bad file descriptor
    __ 8 ENOEXEC__  +Exec format error
    __ 7 E2BIG___  +Argument list too long
    __ 6 ENXIO___  +No such device or address
    __ 5 EIO____  +Input/output error
    __ 4 EINTR___  +Interrupted system call
    __ 3 ESRCH___  +No such process
    __ 2 ENOENT___ +No such file or directory
    __ 1 EPERM___  +Operation not permitted
    #_  0 --_____  Success

     

    附录参考 http://fanqiang.chinaunix.net/a4/b7/20010913/0900001283.html

    摘要:

    讨论关于利用select()检测对方Socket关闭的问题: 
     
    仍然是本地Socket有东东可读,因为对方Socket关闭时,会发一个关闭连接 
    通知报文,会马上被select()检测到的。关于TCP的连接(三次握手)和关 
    闭(二次握手)机制,敬请参考有关TCP/IP的书籍。 
     
    不知是什么原因,UNIX好象没有提供通知进程关于Socket或Pipe对方关闭的 
    信号,也可能是cpu所知有限。总之,当对方关闭,一执行recv()或read(), 
    马上回返回-1,此时全局变量errno的值是115,相应的sys_errlist[errno] 
    为"Connect refused"(请参考/usr/include/sys/errno.h)。所以,在上 
    篇的for(;;)...select()程序块中,当有东西可读时,一定要检查recv()或 
    read()的返回值,返回-1时要作出关断本地Socket的处理,否则select()会 
    一直认为有东西读,其结果曾几令cpu伤心欲断针脚。不信你可以试试:不检 
    查recv()返回结果,且将收到的东东(实际没收到)写至标准输出... 
    在有名管道的编程中也有类似问题出现。具体处理详见拙作:发布一个有用 
    的Socket客户方原码。 
     
    至于主动写Socket时对方突然关闭的处理则可以简单地捕捉信号SIGPIPE并作 
    出相应关断本地Socket等等的处理。SIGPIPE的解释是:写入无读者方的管道。 
    在此不作赘述,请详man signal。 
     
    以上是cpu在作tcp/ip数据传输实验积累的经验,若有错漏,请狂炮击之。 
     
    唉,昨天在hacker区被一帮孙子轰得差点儿没短路。ren cpu(奔腾的心) z80 
     
    补充关于select在异步(非阻塞)connect中的应用,刚开始搞socket编程的时候 
    我一直都用阻塞式的connect,非阻塞connect的问题是由于当时搞proxy scan 
    而提出的呵呵 
    通过在网上与网友们的交流及查找相关FAQ,总算知道了怎么解决这一问题.同样 
    用select可以很好地解决这一问题.大致过程是这样的: 
     
    1.将打开的socket设为非阻塞的,可以用fcntl(socket, F_SETFL, O_NDELAY)完 
    成(有的系统用FNEDLAY也可). 
     
    2.发connect调用,这时返回-1,但是errno被设为EINPROGRESS,意即connect仍旧 
    在进行还没有完成. 
     
    3.将打开的socket设进被监视的可写(注意不是可读)文件集合用select进行监视, 
    如果可写,用 
            getsockopt(socket, SOL_SOCKET, SO_ERROR, &error, sizeof(int)); 
    来得到error的值,如果为零,则connect成功. 
     
    在许多unix版本的proxyscan程序你都可以看到类似的过程,另外在solaris精华 
    区->编程技巧中有一个通用的带超时参数的connect模块. 


    原文链接:

    http://blog.csdn.net/zimu2702/article/details/8060654

    展开全文
  • linux错误码大全

    万次阅读 2014-04-13 14:59:59
    linux错误码大全 (2013-01-19 23:25:59) 转载▼ 标签: 杂谈 分类:linux内核 查看错误代码errno是调试程序的一个重要方法。当linuc Capi函数发生异常时,一般会将errno变量(需...

    linux错误码大全

    查看错误代码errno是调试程序的一个重要方法。当linuc Capi函数发生异常时,一般会将errno变量(需includeerrno.h)赋一个整数值,不同的值表示不同的含义,可以通过查看该值推测出错的原因。在实际编程中用这一招解决了不少原本看来莫名其妙的问题。比较麻烦的是每次都要去linux源代码里面查找错误代码的含义,现在把它贴出来,以后需要查时就来这里看了。


    1-34号错误号是在内核源码的include/asm-generic/errno-base.h定义


    35-132则是在include/asm-generic/errno.h中定义


    剩下还有一些更大的错误号是留给内核级别的,如系统调用等,用户程序一般是看不见的这些号的,Ubuntu9.10中/usr/src/linux-headers-2.6.31-21-generic/include/linux/errno.h

    #ifndef_ASM_GENERIC_ERRNO_BASE_H
    #define_ASM_GENERIC_ERRNO_BASE_H

    #define   EPERM        1   /* Operation not permitted*/
    #define   ENOENT        2   /* No such file or directory*/
    #define   ESRCH        3   /* No such process*/
    #define   EINTR        4   /* Interrupted system call*/
    #define   EIO        5   /* I/O error*/
    #define   ENXIO        6   /* No such device or address*/
    #define   E2BIG        7   /* Argument list too long*/
    #define   ENOEXEC        8   /* Exec format error*/
    #define   EBADF        9   /* Bad file number*/
    #define   ECHILD       10   /* No child processes*/
    #define   EAGAIN       11   /* Try again*/
    #define   ENOMEM       12   /* Out of memory*/
    #define   EACCES       13   /* Permission denied*/
    #define   EFAULT       14   /* Bad address*/
    #define   ENOTBLK       15   /* Block device required*/
    #define   EBUSY       16   /* Device or resource busy*/
    #define   EEXIST       17   /* File exists*/
    #define   EXDEV       18   /* Cross-device link*/
    #define   ENODEV       19   /* No such device*/
    #define   ENOTDIR       20   /* Not a directory*/
    #define   EISDIR       21   /* Is a directory*/
    #define   EINVAL       22   /* Invalid argument*/
    #define   ENFILE       23   /* File table overflow*/
    #define   EMFILE       24   /* Too many open files*/
    #define   ENOTTY       25   /* Not a typewriter*/
    #define   ETXTBSY       26   /* Text file busy*/
    #define   EFBIG       27   /* File too large*/
    #define   ENOSPC       28   /* No space left on device*/
    #define   ESPIPE       29   /* Illegal seek*/
    #define   EROFS       30   /* Read-only file system*/
    #define   EMLINK       31   /* Too many links*/
    #define   EPIPE       32   /* Broken pipe*/
    #define   EDOM       33   /* Math argument out of domainof func */
    #define   ERANGE       34   /* Math result notrepresentable */

    #endif


    #include<asm-generic/errno-base.h>

    #define   EDEADLK       35   /* Resource deadlock wouldoccur */
    #define   ENAMETOOLONG   36   /* File name too long */
    #define   ENOLCK       37   /* No record locks available*/
    #define   ENOSYS       38   /* Function not implemented*/
    #define   ENOTEMPTY   39    /*Directory not empty */
    #define   ELOOP       40   /* Too many symbolic linksencountered */
    #define   EWOULDBLOCK   EAGAIN    /*Operation would block */
    #define   ENOMSG       42   /* No message of desired type*/
    #define   EIDRM       43   /* Identifier removed*/
    #define   ECHRNG       44   /* Channel number out of range*/
    #define   EL2NSYNC   45    /* Level2 not synchronized */
    #define   EL3HLT       46   /* Level 3 halted*/
    #define   EL3RST       47   /* Level 3 reset*/
    #define   ELNRNG       48   /* Link number out of range*/
    #define   EUNATCH       49   /* Protocol driver notattached */
    #define   ENOCSI       50   /* No CSI structure available*/
    #define   EL2HLT       51   /* Level 2 halted*/
    #define   EBADE       52   /* Invalid exchange*/
    #define   EBADR       53   /* Invalid request descriptor*/
    #define   EXFULL       54   /* Exchange full*/
    #define   ENOANO       55   /* No anode*/
    #define   EBADRQC       56   /* Invalid request code*/
    #define   EBADSLT       57   /* Invalid slot*/

    #define   EDEADLOCK   EDEADLK
    #define   EBFONT       59   /* Bad font file format*/
    #define   ENOSTR       60   /* Device not a stream*/
    #define   ENODATA       61   /* No data available*/
    #define   ETIME       62   /* Timer expired*/
    #define   ENOSR       63   /* Out of streams resources*/
    #define   ENONET       64   /* Machine is not on thenetwork */
    #define   ENOPKG       65   /* Package not installed*/
    #define   EREMOTE       66   /* Object is remote*/
    #define   ENOLINK       67   /* Link has been severed*/
    #define   EADV       68   /* Advertise error*/
    #define   ESRMNT       69   /* Srmount error*/
    #define   ECOMM       70   /* Communication error on send*/
    #define   EPROTO       71   /* Protocol error*/
    #define   EMULTIHOP   72    /*Multihop attempted */
    #define   EDOTDOT       73   /* RFS specific error*/
    #define   EBADMSG       74   /* Not a data message*/
    #define   EOVERFLOW   75    /* Valuetoo large for defined data type */
    #define   ENOTUNIQ   76    /* Namenot unique on network */
    #define   EBADFD       77   /* File descriptor in badstate */
    #define   EREMCHG       78   /* Remote address changed*/
    #define   ELIBACC       79   /* Can not access a neededshared library */
    #define   ELIBBAD       80   /* Accessing a corruptedshared library */
    #define   ELIBSCN       81   /* .lib section in a.outcorrupted */
    #define   ELIBMAX       82   /* Attempting to link in toomany shared libraries */
    #define   ELIBEXEC   83    /* Cannotexec a shared library directly */
    #define   EILSEQ       84   /* Illegal byte sequence*/
    #define   ERESTART   85    /*Interrupted system call should be restarted */
    #define   ESTRPIPE   86    /*Streams pipe error */
    #define   EUSERS       87   /* Too many users*/
    #define   ENOTSOCK   88    /* Socketoperation on non-socket */
    #define   EDESTADDRREQ   89   /* Destination address required*/
    #define   EMSGSIZE   90    /*Message too long */
    #define   EPROTOTYPE   91    /*Protocol wrong type for socket */
    #define   ENOPROTOOPT   92    /*Protocol not available */
    #define   EPROTONOSUPPORT   93   /* Protocol not supported */
    #define   ESOCKTNOSUPPORT   94   /* Socket type not supported*/
    #define   EOPNOTSUPP   95    /*Operation not supported on transport endpoint*/
    #define   EPFNOSUPPORT   96   /* Protocol family not supported*/
    #define   EAFNOSUPPORT   97   /* Address family not supported by protocol*/
    #define   EADDRINUSE   98    /*Address already in use */
    #define   EADDRNOTAVAIL   99   /* Cannot assign requested address*/
    #define   ENETDOWN   100    /*Network is down */
    #define   ENETUNREACH   101    /*Network is unreachable */
    #define   ENETRESET   102    /*Network dropped connection because of reset */
    #define   ECONNABORTED   103   /* Software caused connection abort*/
    #define   ECONNRESET   104    /*Connection reset by peer */
    #define   ENOBUFS       105   /* No buffer space available*/
    #define   EISCONN       106   /* Transport endpoint isalready connected */
    #define   ENOTCONN   107    /*Transport endpoint is not connected */
    #define   ESHUTDOWN   108    /*Cannot send after transport endpoint shutdown*/
    #define   ETOOMANYREFS   109   /* Too many references: cannot splice*/
    #define   ETIMEDOUT   110    /*Connection timed out */
    #define   ECONNREFUSED   111   /* Connection refused */
    #define   EHOSTDOWN   112    /* Hostis down */
    #define   EHOSTUNREACH   113   /* No route to host */
    #define   EALREADY   114    /*Operation already in progress */
    #define   EINPROGRESS   115    /*Operation now in progress */
    #define   ESTALE       116   /* Stale NFS file handle*/
    #define   EUCLEAN       117   /* Structure needs cleaning*/
    #define   ENOTNAM       118   /* Not a XENIX named type file*/
    #define   ENAVAIL       119   /* No XENIX semaphoresavailable */
    #define   EISNAM       120   /* Is a named type file*/
    #define   EREMOTEIO   121    /*Remote I/O error */
    #define   EDQUOT       122   /* Quota exceeded*/
    #define   ENOMEDIUM   123    /* Nomedium found */
    #define   EMEDIUMTYPE   124    /* Wrongmedium type */
    #define   ECANCELED   125    /*Operation Canceled */
    #define   ENOKEY       126   /* Required key not available*/
    #define   EKEYEXPIRED   127    /* Keyhas expired */
    #define   EKEYREVOKED   128    /* Keyhas been revoked */
    #define   EKEYREJECTED   129   /* Key was rejected by service*/

    /* forrobust mutexes */
    #define   EOWNERDEAD   130    /* Ownerdied */
    #define   ENOTRECOVERABLE   131   /* State not recoverable */

    #defineERFKILL       132    /*Operation not possible due to RF-kill */


    #ifdef__KERNEL__

    /*
     * These should never be seenby user programs. To return one of ERESTART*
     * codes, signal_pending()MUST be set. Note that ptrace can observe these
     * at syscall exit tracing,but they will never be left for the debuggeduser
     * process tosee.
    */
    #defineERESTARTSYS   512
    #defineERESTARTNOINTR   513
    #defineERESTARTNOHAND    514   /* restart if no handler..*/
    #defineENOIOCTLCMD    515   /* No ioctl command*/
    #defineERESTART_RESTARTBLOCK 516 /* restart by calling sys_restart_syscall*/

    /*Defined for the NFSv3 protocol */
    #defineEBADHANDLE    521   /* Illegal NFS file handle*/
    #defineENOTSYNC    522   /* Update synchronizationmismatch */
    #defineEBADCOOKIE    523   /* Cookie is stale*/
    #defineENOTSUPP    524   /* Operation is not supported*/
    #defineETOOSMALL    525   /* Buffer or request is toosmall */
    #defineESERVERFAULT    526   /* An untranslatable erroroccurred */
    #defineEBADTYPE    527   /* Type not supported byserver */
    #defineEJUKEBOX    528   /* Request initiated, but willnot complete before timeout */
    #defineEIOCBQUEUED    529   /* iocb queued, will getcompletion event */
    #defineEIOCBRETRY    530   /* iocb queued, will trigger aretry */

    #endif



    展开全文
  • Linux错误码汇总

    2019-12-18 15:08:00
    常用linux错误代码含义,如下表所示: 名称 值 描述 EPERM 1 操作不允许 ENOENT 2 无此文件或目录 ESRCH 3 无此进程 EINTR 4 中断系统调用 EIO 5 I/O 错误 ENXIO 6 无此...

    常用linux错误代码含义,如下表所示:

    名称

    描述

    EPERM

    1

    操作不允许

    ENOENT

    2

    无此文件或目录

    ESRCH

    3

    无此进程

    EINTR

    4

    中断系统调用

    EIO

    5

    I/O 错误

    ENXIO

    6

    无此设备或地址

    E2BIG

    7

    参数列表过长

    ENOEXEC

    8

    执行文件错误

    EBADF

    9

    错误的文件数

    ECHILD

    10

    无子进程

    EAGAIN

    11

    再尝试一下

    ENOMEM

    12

    内存溢出

    EACCES

    13

    要求被否定

    EFAULT

    14

    错误地址

    ENOTBLK

    15

    块设备请求

    EBUSY

    16

    设备或者资源忙

    EEXIST

    17

    文件存在

    EXDEV

    18

    Cross-device link

    ENODEV

    19

    无此设备

    ENOTDIR

    20

    不是一个目录文件

    EISDIR

    21

    I是一个目录文件

    EINVAL

    22

    无效的参数

    ENFILE

    23

    文件表溢出

    EMFILE

    24

    打开文件过多

    ENOTTY

    25

    不是一个TTY设备

    ETXTBSY

    26

    文件忙

    EFBIG

    27

    文件过大

    ENOSPC

    28

    此设备上没有空间了

    ESPIPE

    29

    无效的偏移

    EROFS

    30

    只读文件系统

    EMLINK

    31

    链接过多

    EPIPE

    32

    错误的管道

    EDOM

    33

    Math argument out of domain

    ERANGE

    34

    Math result not representable

    EDEADLK

    35

    Resource deadlock would occur

    ENAMETOOLONG

    36

    文件名过长

    ENOLCK

    37

    No record locks available

    ENOSYS

    38

    函数没有实现

    ENOTEMPTY

    39

    目录非空

    ELOOP

    40

    Too many symbolic links encountered

    EWOULDBLOCK

    41

    Same as EAGAIN

    ENOMSG

    42

    No message of desired type

    EIDRM

    43

    Identifier removed

    ECHRNG

    44

    Channel number out of range

    EL2NSYNC

    45

    Level 2 not synchronized

    EL3HLT

    46

    Level 3 halted

    EL3RST

    47

    Level 3 reset

    ELNRNG

    48

    Link number out of range

    EUNATCH

    49

    Protocol driver not attached

    ENOCSI

    50

    No CSI structure available

    EL2HLT

    51

    Level 2 halted

    EBADE

    52

    Invalid exchange

    EBADR

    53

    Invalid request descriptor

    EXFULL

    54

    Exchange full

    ENOANO

    55

    No anode

    EBADRQC

    56

    Invalid request code

    EBADSLT

    57

    Invalid slot

    EDEADLOCK

     -

    Same as EDEADLK

    EBFONT

    59

    Bad font file format

    ENOSTR

    60

    Device not a stream

    ENODATA

    61

    No data available

    ETIME

    62

    Timer expired

    ENOSR

    63

    Out of streams resources

    ENONET

    64

    Machine is not on the network

    ENOPKG

    65

    Package not installed

    EREMOTE

    66

    Object is remote

    ENOLINK

    67

    Link has been severed

    EADV

    68

    Advertise error

    ESRMNT

    69

    Srmount error

    ECOMM

    70

    Communication error on send

    EPROTO

    71

    Protocol error

    EMULTIHOP

    72

    Multihop attempted

    EDOTDOT

    73

    RFS specific error

    EBADMSG

    74

    Not a data message

    EOVERFLOW

    75

    Value too large for defined data type

    ENOTUNIQ

    76

    Name not unique on network

    EBADFD

    77

    File descriptor in bad state

    EREMCHG

    78

    Remote address changed

    ELIBACC

    79

    Cannot access a needed shared library

    ELIBBAD

    80

    Accessing a corrupted shared library

    ELIBSCN

    81

    A .lib section in an .out is corrupted

    ELIBMAX

    82

    Linking in too many shared libraries

    ELIBEXEC

    83

    Cannot exec a shared library directly

    EILSEQ

    84

    Illegal byte sequence

    ERESTART

    85

    Interrupted system call should be restarted

    ESTRPIPE

    86

    Streams pipe error

    EUSERS

    87

    Too many users

    ENOTSOCK

    88

    Socket operation on non-socket

    EDESTADDRREQ

    89

    Destination address required

    EMSGSIZE

    90

    Message too long

    EPROTOTYPE

    91

    Protocol wrong type for socket

    ENOPROTOOPT

    92

    Protocol not available

    EPROTONOSUPPORT

    93

    Protocol not supported

    ESOCKTNOSUPPORT

    94

    Socket type not supported

    EOPNOTSUPP

    95

    Operation not supported on transport

    EPFNOSUPPORT

    96

    Protocol family not supported

    EAFNOSUPPORT

    97

    Address family not supported by protocol

    EADDRINUSE

    98

    Address already in use

    EADDRNOTAVAIL

    99

    Cannot assign requested address

    ENETDOWN

    100

    Network is down

    ENETUNREACH

    101

    Network is unreachable

    ENETRESET

    102

    Network dropped

    ECONNABORTED

    103

    Software caused connection

    ECONNRESET

    104

    Connection reset by

    ENOBUFS

    105

    No buffer space available

    EISCONN

    106

    Transport endpoint

    ENOTCONN

    107

    Transport endpoint

    ESHUTDOWN

    108

    Cannot send after transport

    ETOOMANYREFS

    109

    Too many references

    ETIMEDOUT

    110

    Connection timed

    ECONNREFUSED

    111

    Connection refused

    EHOSTDOWN

    112

    Host is down

    EHOSTUNREACH

    113

    No route to host

    EALREADY

    114

    Operation already

    EINPROGRESS

    115

    Operation now in

    ESTALE

    116

    Stale NFS file handle

    EUCLEAN

    117

    Structure needs cleaning

    ENOTNAM

    118

    Not a XENIX-named

    ENAVAIL

    119

    No XENIX semaphores

    EISNAM

    120

    Is a named type file

    EREMOTEIO

    121

    Remote I/O error

    EDQUOT

    122

    Quota exceeded

    ENOMEDIUM

    123

    No medium found

    EMEDIUMTYPE

    124

    Wrong medium type


    展开全文
  • Linux错误码查看

    千次阅读 2014-08-05 20:03:41
    在用Linux下写C的代码的时候,利用open、create函数总是会出现错误 但是

    在用Linux下写C的代码的时候,利用open、create函数总是会出现错误

    但是返回值为 -1 ,并不能定位错误在哪里,所以查看系统提供的错误码就显得特别有必要了

    需要包含头文件 <errno.h> 并且定义一个 extern int errno 之后打印出来变量 errno 查看错误码

    <errno.h> 在 /var/include/asm/ermo_bash.h 和 ermo.h 

    这两个头文件中都有错误码,这样在函数后面加上一个 printf 就可以定位错误的原因

    我的错误码是13,其原因在于服务器拒绝对系统默认文件夹进行写入操作

    导致无法在文件夹下进行创建新文件的动作

    没找到解决办法,在外层文件夹下将就了,迫不得以破坏了文件的存放规律

    附上一份错误码的表,以后就不需要每次都去翻两个文件了

    #ifndef _I386_ERRNO_H

    #define _I386_ERRNO_H

    #define EPERM           1 /* Operation not permitted */
    #define ENOENT          2 /* No such file or directory */
    #define ESRCH           3 /* No such process */
    #define EINTR           4 /* Interrupted system call */
    #define EIO             5 /* I/O error */
    #define ENXIO           6 /* No such device or address */
    #define E2BIG           7 /* Arg list too long */
    #define ENOEXEC         8 /* Exec format error */
    #define EBADF           9 /* Bad file number */
    #define ECHILD          10 /* No child processes */
    #define EAGAIN          11 /* Try again */
    #define ENOMEM          12 /* Out of memory */
    #define EACCES          13 /* Permission denied */ //这是我今天遇到的问题
    #define EFAULT          14 /* Bad address */
    #define ENOTBLK         15 /* Block device required */
    #define EBUSY           16 /* Device or resource busy */
    #define EEXIST          17 /* File exists */
    #define EXDEV           18 /* Cross-device link */
    #define ENODEV          19 /* No such device */
    #define ENOTDIR         20 /* Not a directory */
    #define EISDIR          21 /* Is a directory */
    #define EINVAL          22 /* Invalid argument */
    #define ENFILE          23 /* File table overflow */
    #define EMFILE          24 /* Too many open files */
    #define ENOTTY          25 /* Not a typewriter */
    #define ETXTBSY         26 /* Text file busy */
    #define EFBIG           27 /* File too large */
    #define ENOSPC          28 /* No space left on device */
    #define ESPIPE          29 /* Illegal seek */
    #define EROFS           30 /* Read-only file system */
    #define EMLINK          31 /* Too many links */
    #define EPIPE           32 /* Broken pipe */
    #define EDOM            33 /* Math argument out of domain of func */
    #define ERANGE          34 /* Math result not representable */
    #define EDEADLK         35      /* Resource deadlock would occur */
    #define ENAMETOOLONG    36      /* File name too long */
    #define ENOLCK          37      /* No record locks available */
    #define ENOSYS          38      /* Function not implemented */
    #define ENOTEMPTY       39      /* Directory not empty */
    #define ELOOP           40      /* Too many symbolic links encountered */
    #define EWOULDBLOCK     EAGAIN  /* Operation would block */
    #define ENOMSG          42      /* No message of desired type */
    #define EIDRM           43      /* Identifier removed */
    #define ECHRNG          44      /* Channel number out of range */
    #define EL2NSYNC        45      /* Level 2 not synchronized */
    #define EL3HLT          46      /* Level 3 halted */
    #define EL3RST          47      /* Level 3 reset */
    #define ELNRNG          48      /* Link number out of range */
    #define EUNATCH         49      /* Protocol driver not attached */
    #define ENOCSI          50      /* No CSI structure available */
    #define EL2HLT          51      /* Level 2 halted */
    #define EBADE           52      /* Invalid exchange */
    #define EBADR           53      /* Invalid request descriptor */
    #define EXFULL          54      /* Exchange full */
    #define ENOANO          55      /* No anode */
    #define EBADRQC         56      /* Invalid request code */
    #define EBADSLT         57      /* Invalid slot */
    #define EDEADLOCK       EDEADLK
    #define EBFONT          59      /* Bad font file format */
    #define ENOSTR          60      /* Device not a stream */
    #define ENODATA         61      /* No data available */
    #define ETIME           62      /* Timer expired */
    #define ENOSR           63      /* Out of streams resources */
    #define ENONET          64      /* Machine is not on the network */
    #define ENOPKG          65      /* Package not installed */
    #define EREMOTE         66      /* Object is remote */
    #define ENOLINK         67      /* Link has been severed */
    #define EADV            68      /* Advertise error */
    #define ESRMNT          69      /* Srmount error */
    #define ECOMM           70      /* Communication error on send */
    #define EPROTO          71      /* Protocol error */
    #define EMULTIHOP       72      /* Multihop attempted */
    #define EDOTDOT         73      /* RFS specific error */
    #define EBADMSG         74      /* Not a data message */
    #define EOVERFLOW       75      /* Value too large for defined data type */
    #define ENOTUNIQ        76      /* Name not unique on network */
    #define EBADFD          77      /* File descriptor in bad state */
    #define EREMCHG         78      /* Remote address changed */
    #define ELIBACC         79      /* Can not access a needed shared library */
    #define ELIBBAD         80      /* Accessing a corrupted shared library */
    #define ELIBSCN         81      /* .lib section in a.out corrupted */
    #define ELIBMAX         82      /* Attempting to link in too many shared libraries */
    #define ELIBEXEC        83      /* Cannot exec a shared library directly */
    #define EILSEQ          84      /* Illegal byte sequence */
    #define ERESTART        85      /* Interrupted system call should be restarted */
    #define ESTRPIPE        86      /* Streams pipe error */
    #define EUSERS          87      /* Too many users */
    #define ENOTSOCK        88      /* Socket operation on non-socket */
    #define EDESTADDRREQ    89      /* Destination address required */
    #define EMSGSIZE        90      /* Message too long */
    #define EPROTOTYPE      91      /* Protocol wrong type for socket */
    #define ENOPROTOOPT     92      /* Protocol not available */
    #define EPROTONOSUPPORT 93      /* Protocol not supported */
    #define ESOCKTNOSUPPORT 94      /* Socket type not supported */
    #define EOPNOTSUPP      95      /* Operation not supported on transport endpoint */
    #define EPFNOSUPPORT    96      /* Protocol family not supported */
    #define EAFNOSUPPORT    97      /* Address family not supported by protocol */
    #define EADDRINUSE      98      /* Address already in use */
    #define EADDRNOTAVAIL   99      /* Cannot assign requested address */
    #define ENETDOWN        100     /* Network is down */
    #define ENETUNREACH     101     /* Network is unreachable */
    #define ENETRESET       102     /* Network dropped connection because of reset */
    #define ECONNABORTED    103     /* Software caused connection abort */
    #define ECONNRESET      104     /* Connection reset by peer */
    #define ENOBUFS         105     /* No buffer space available */
    #define EISCONN         106     /* Transport endpoint is already connected */
    #define ENOTCONN        107     /* Transport endpoint is not connected */
    #define ESHUTDOWN       108     /* Cannot send after transport endpoint shutdown */
    #define ETOOMANYREFS    109     /* Too many references: cannot splice */
    #define ETIMEDOUT       110     /* Connection timed out */
    #define ECONNREFUSED    111     /* Connection refused */
    #define EHOSTDOWN       112     /* Host is down */
    #define EHOSTUNREACH    113     /* No route to host */
    #define EALREADY        114     /* Operation already in progress */
    #define EINPROGRESS     115     /* Operation now in progress */
    #define ESTALE          116     /* Stale NFS file handle */
    #define EUCLEAN         117     /* Structure needs cleaning */
    #define ENOTNAM         118     /* Not a XENIX named type file */
    #define ENAVAIL         119     /* No XENIX semaphores available */
    #define EISNAM          120     /* Is a named type file */
    #define EREMOTEIO       121     /* Remote I/O error */
    #define EDQUOT          122     /* Quota exceeded */
    #define ENOMEDIUM       123     /* No medium found */
    #define EMEDIUMTYPE     124     /* Wrong medium type */
    #define ECANCELED       125     /* Operation Canceled */
    #define ENOKEY          126     /* Required key not available */
    #define EKEYEXPIRED     127     /* Key has expired */
    #define EKEYREVOKED     128     /* Key has been revoked */
    #define EKEYREJECTED    129     /* Key was rejected by service */
    /* for robust mutexes */
    #define EOWNERDEAD      130     /* Owner died */
    #define ENOTRECOVERABLE 131     /* State not recoverable */
    #endif

    展开全文
  • Linux内核错误码与错误指针

    千次阅读 2017-03-06 15:52:40
    在内核中定义了一些列错误码,以指示不同的出错情况,同时还定义了相关的错误指针
  • Linux错误码编码

    千次阅读 2012-03-08 21:26:25
    //linux-2.6.36 //翻译professional linux kernel architecture §2.4.4 #define MAX_ERRNO 4095 //0~~~4KiB虚拟空间 #ifndef __ASSEMBLY__ #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-...
  • 本文描述linux程序开发中返回错误码具体含义和查询方式。
  • linux socket 错误码

    千次阅读 2014-03-24 15:05:16
    errno.110 is: Connection timed out errno.111 is: Connection refused errno.112 is: Host is down errno.113 is: No route to host errno.114 is: Operation already in progress errno.115 is: ...
  • Linux错误码以及exitCode

    2019-05-20 11:29:41
    错误码 程序退出码: SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 SIGSEGV 12) SIGUSR2 13) SIGPIPE ...
  • 现在错误码是: segfault at bfbdd69b ip 00000000bfbdd69b sp 00007fff77a5f368 error 14 in zero (deleted)[7f65bfbdd000+7a2000] 这是什么原因造成的呢,看到了错误码的定义但还是不太明白 /* * Page ...
  • 我们知道,在linux下,我们用errno来查看API返回错误码,并用strerror(errno)来获得错误信息。而在windows下也有这的错误码,可以用GetLastError来获得,在windows下,要获得错误码对应的信息就没有linux下那么...
  • Linux错误码EAGAIN与EWOULDBLOCK

    千次阅读 2014-03-18 16:31:42
    linux下开发经常遇到一些错误,errno 在进行非阻塞IO编程时,调用read/recv,经常会返回EAGAIN(11)这个错误。 由于read/recv立即返回,但是此时并没有数据可读,就会返回这个错误。 如果使用fork创建进程,如果资源...
  • 参考链接 - What are the standard ...使用 ‘errno -ls’ 命令,查看错误码 错误码(error code)列表 错误码列表生成程序 1. Ubuntu 中安装 ‘errno’ 命令: ubuntu@cuname:~$ sudo apt-get install mor...
  • Linux错误码及描述

    千次阅读 2014-06-23 17:41:15
    每次运行一个命令,Linux都会返回一个错误码(整数,一般为0~256),那么这些数字都表示什么意思呢?今天强子告诉大家3种方法(注:我的平台的Fedora 7,其他平台可参考): 1. 简单明了,一个命令,想看什么看什么:...
  • errno用于Linux下的错误捕获,在运行creat(),open(),write()之类的函数时有些时候会调用失败返回-1,这时候若在程序中include&lt;errno.h&gt;这个头文件,每次发生错误时,系统会自动用错误代码填充...
  • Linux 标准错误码参考

    千次阅读 2018-07-26 10:32:01
    按Ctrl键+ G键“ - 提升标题`` - 有序列表`按百按按'顺序','无序列表','按'按CTRL + U` - 横线`按按按Ctrl +按住Ctrl + [R` - 撤销`按住Ctrl +键菜键键键键` ...
  • linux c 错误码大全及错误的捕获

    千次阅读 2019-04-15 17:54:56
    经常在调用linux系统api的时候会出现一些错误,比方说使用open()write()creat()之类的函数有些时候会返回-1,也就是调用失败,这个时候往往需要知道失败的原因。这个时候使用errno这个全局变量就相当有用了。在程序...
  • Linux远程登录可以,在本机上登录就提示密码错误,都用的是root用户,在远程端更改密码后,在本机还是不行,在远程机上就可以。
  • 1、启动虚拟机,出现下面的倒计时界面时,按键盘上的e键.。 (注意:要确保光标此时已经在虚拟机内了,要不然,按了e键,也是在windows内,无效。e代表edit,启动前编辑) 2、进入如下后界面,再按e键。...
  • linux系统调用错误码 errno

    千次阅读 2019-04-26 08:05:27
    为防止和正常的返回值混淆,系统调用并不直接返回错误码,而是将错误码放入一个名为errno的全局变量中。如果一个系统调用失败,你可以读出errno的值来确定问题所在。 errno不同数值所代表的错误消息定义在errno.h中...
  • 错误码 Linux中系统调用的错误都存储于 errno中,头文件errno.h,范围为0-255 Errno只保存最近一次的系统错误(一般用在调用系统函数时),下一次的错误码会覆盖掉上一次的错误。 在单线程的程序中,errno是全局...
  • Linux内核中,一个返回指针的函数应该使用什么样的值来表示错误返回呢,很显然,使用一个空指针NULL是根本无法表示和区分各式各样的执行错误的,所以正确的作法就是要使用一组特定的指针来表示,并且还要将这些...
  • 个人博客原文:http://www.lampnick.com/php/261在linux系统下使用zipArchive压缩文件,采用ZipArchive::OVERWRITE方式,发现打开失败,打印返回错误码为:9,查看官方文档 错误码9代表没有这个文件, $zip = new...
  • linux命令返回值-错误码对照表

    千次阅读 2017-12-05 10:18:51
    110 : Connection timed out " " OS error code 111 : Connection refused " " OS error code 112 : Host is down " " OS error code 113 : No route to host " " OS error code 114 : Operation ...
  • linux 用户名 密码错误修改

    千次阅读 2012-08-13 17:38:01
    先在虚拟机中启动Red Hat Linux。  2.在Grub引导程序中,在下面给出了一系列提示。有兴趣的朋友可以都去试验一下。我们这里按“e”键进入系统启动前的Grub配置.  3.然后我们选择中间那一项:“kernel /vmlinuz-...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 537,493
精华内容 214,997
关键字:

linux错误码110

linux 订阅