A.4 errno Values

errno is an external variable whose value is set whenever an error occurs during a call to any of the DEC C RTL routines. You can use this value to obtain a more detailed description of the error. errno is not cleared on successful calls, so its value should be checked only when an error has been indicated.

Most calls to the DEC C RTL routines have one or more returned values. Any error condition is indicated by an otherwise impossible return value. This is almost always -1; the individual routine descriptions specify the details.

All return codes and values from routines are of type int unless otherwise noted. An error number is also made available in the external variable errno, which is not cleared on successful calls. The errno values may be translated to a message, similar to that found in UNIX systems, by using the perror routine. vaxc$errno may also be returned as an error.


NOTE
The notation [...] is used in this manual to denote an errno error.

Table A-2 lists the errno values.

Table A-2 errno Values

Value  Meaning 
EINPROGRESS  Operation now in progress 
  An operation that takes a long time to complete, such as connect, was attempted on a nonblocking object. 
EALREADY  Operation already in progress 
  An operation was attempted on a nonblocking object that already had an operation in progress. 
ENOTSOCK  Socket operation on a non-socket 
EDESTADDRREQ  Destination address required 
  A required address was omitted from an operation on a socket. 
EMSGSIZE  Message too long 
  A message sent on a socket was larger than the internal message buffer. 
EPROTOTYPE  Protocol wrong type for socket 
  A protocol was specified that does not support the semantics of the socket type requested. For example, you cannot use the ARPA Internet UDP protocol with type SOCK_STREAM. 
ENOPROTOOPT  Protocol not available 
  A bad option was specified in a getsockopt or setsocketopt call. 
EPROTONOSUPPORT  Protocol not supported 
  The protocol has not been configured into the system or no implementation for it exists. 
ESOCKTNOSUPPORT  Socket type not supported 
  The support for the socket type has not been configured into the system or no implementation for it exists. 
EOPNOTSUPP  Error-operation not supported 
  For example, trying to accept a connection on a datagram socket. 
EPFNOSUPPORT  Protocol family not supported 
  The protocol family has not been configured into the system or no implementation for it exists. 
EAFNOSUPPORT  Address family not supported by protocol family 
  An address incompatible with the requested protocol was used. 
EADDRINUSE  Address already in use 
  Each address can be used only once. 
EADDRNOTAVAIL  Cannot assign requested address 
  Normally, results from an attempt to create a socket with an address not on this machine. 
ENETDOWN  Network is down 
  A socket operation encountered a dead network. 
ENETUNREACH  Network is unreachable 
  A socket operation was attempted to an unreachable network. 
ENETRESET  Network dropped connection on reset 
  The host you were connected to crashed and rebooted. 
ECONNABORTED  Software caused connection abort 
  A connection abort was caused internal to your host machine. 
ECONNRESET  Connection reset by peer 
  A connection was forcibly closed by a peer. This usually results from the peer executing a shutdown call. 
ENOBUFS  No buffer space available 
  An operation on a socket or pipe was not performed because the system lacked sufficient buffer space. 
EISCONN  Socket is already connected 
  A connect request was made on an already connected socket; or, a sendto or sendmsg request on a connected socket specified a destination other than the connected party. 
ENTOTCONN  Socket is not connected 
  Request to send or receive data was disallowed because the socket is not connected. 
ESHUTDOWN  Cannot send after socket shutdown 
  A request to send data was disallowed because the socket had already been shut down with a previous shutdown call. 
ETOOMANYREFS  Too many references: cannot splice 
ETIMEDOUT  Connection timed out 
  A connect request failed because the connected party did not properly respond after a period of time. (The timeout period is dependent on the communication protocol.) A connect request or remote file operation failed because the connected party did not properly respond after a period of time that is dependent on the communication protocol. 
ECONNREFUSED  Connection refused 
  No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host. 
ELOOP  Too many levels of symbolic links 
  A path name lookup involved more than eight symbolic links. 
ENAMETOOLONG  File name too long 
  A component of a path name exceeded 255 characters, or an entire path name exceeded 1023 characters. 
EHOSTDOWN  Host is down 
  A socket operation failed because the destination host was down. 
EHOSTUNREACH  No route to host 
  A socket operation was attempted to an unreachable host. 
EVMSERR  OpenVMS system-specific error code that is nontranslatable 


Previous Page | Next Page | Table of Contents | Index