- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
char *errdesc;
[...]
switch errno
{
case EACCES: errdesc="For Unix domain sockets, which are identified by pathname: Write permission is denied on the socket file, or search permission is denied for one of the directories in the path prefix. (See also path_resolution(2).) " ;break;
case EPERM: errdesc="The user tried to connect to a broadcast address without having the socket broadcast flag enabled or the connection request failed because of a local firewall rule. ";break;
case EADDRINUSE: errdesc="Local address is already in use. ";break;
case EAFNOSUPPORT: errdesc="The passed address didn't have the correct address family in its sa_family field. ";break;
case EAGAIN: errdesc="No more free local ports or insufficient entries in the routing cache. For PF_INET see the net.ipv4.ip_local_port_range sysctl in ip(7) on how to increase the number of local ports. ";break;
case EALREADY: errdesc="The socket is non-blocking and a previous connection attempt has not yet been completed. ";break;
case EBADF: errdesc="The file descriptor is not a valid index in the descriptor table. ";break;
case ECONNREFUSED: errdesc="No one listening on the remote address. ";break;
case EFAULT: errdesc="The socket structure address is outside the user's address space. ";break;
case EINPROGRESS: errdesc="The socket is non-blocking and the connection cannot be completed immediately. It is possible to select(2) or poll(2) for completion by selecting the socket for writing. After select(2) indicates writability, use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to determine whether connect() completed successfully (SO_ERROR is zero) or unsuccessfully (SO_ERROR is one of the usual error codes listed here, explaining the reason for the failure). ";break;
case EINTR: errdesc="The system call was interrupted by a signal that was caught. ";break;
case EISCONN: errdesc="The socket is already connected. ";break;
case ENETUNREACH: errdesc="Network is unreachable. ";break;
case ENOTSOCK: errdesc="The file descriptor is not associated with a socket. ";break;
case ETIMEDOUT: errdesc="Timeout while attempting connection. The server may be too busy to accept new connections. Note that for IP sockets the timeout may be very long when syncookies are enabled on the server.";break;
case EADDRNOTAVAIL: errdesc="EADDRNOTAVAIL";break;
case EPROTOTYPE: errdesc="EPROTOTYPE";break;
case EINVAL: errdesc="Invalid argument passed.";break;
case ENOMEM: errdesc="Could not allocate memory for recvmsg().";break;
case ENOTCONN: errdesc="The socket is associated with a connection-oriented protocol and has not been connected (see connect(2) and accept(2)).";break;
default: errdesc="Unknown error";break;
}
Мдя, просматривать код писанный мной же, когда я ещё только-только начинал писать на Си стыдновато. :)
xaionaro 28.02.2010 15:59 # −1
comnimh 28.02.2010 16:09 # 0
comnimh 28.02.2010 16:10 # 0
xaionaro 28.02.2010 16:28 # 0
comnimh 28.02.2010 16:28 # 0
Pencioner 06.03.2010 20:57 # −1
xaionaro 12.03.2010 16:20 # −0.8
guestinho 26.07.2016 22:46 # 0
Ого, а так можно?
bormand 26.07.2016 22:47 # 0
TEPAnEBT 26.07.2016 22:49 # 0
Гоните же его скорей ко мне!..
TEPAnEBT 26.07.2016 23:00 # 0
TEPAnEBT 26.07.2016 23:01 # 0
TEPAnEBT 26.07.2016 23:01 # 0
TEPAnEBT 26.07.2016 23:02 # 0
TEPAnEBT 26.07.2016 23:02 # 0
TEPAnEBT 26.07.2016 23:03 # +1
1024-- 27.07.2016 16:16 # 0