Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

ERRNO(2)  —  HP-UX

NAME

errno − error indicator for system calls

SYNOPSIS

#include <errno.h>
extern int errno;

DESCRIPTION

Errno is an external variable whose value is set whenever an error occurs in a system call.  This value can be used to obtain a more detailed description of the error.  An error condition is indicated by an otherwise impossible returned value.  This is almost always −1; the individual descriptions specify the details.  Errno is not cleared on successful system calls, so its value should be checked only when an error has been indicated. 

Each system call description attempts to list all possible error numbers.  The following is a complete list of the error names.  The numeric values can be found in <errno.h> but should not normally be used. 

E2BIG Arg list too long
An argument and or environment list longer than maximum supported size is presented to a member of the exec family.  Other possibilities include: message size or number of semaphores exceeds system limit (msgop, semop), or too many privileged groups have been set up (setprivgrp). 

EACCES Permission denied
An attempt was made to access a file or IPC object in a way forbidden by the protection system.

EADDRINUSE Address already in use
Only one usage of each address is normally permitted.

EADDRNOTAVAIL
Can not assign requested address
Normally results from an attempt to create a socket with an address not on this machine.

EAFNOSUPPORT
Address family not supported by protocol family
An address incompatible with the requested protocol was used. For example, you should not necessarily expect to be able to use PUP Internet addresses with ARPA Internet protocols.

EAGAIN No more processes
A fork failed because the system’s process table is full or the user is not allowed to create any more processes, or a semop or msgop call would have to block. 

EALREADY Operation already in progress
An operation was attempted on a non-blocking object which already had an operation in progress.

EBADF Bad file number
Either a file descriptor refers to no open file, a read (respectively write) request is made to a file which is open only for writing (respectively reading), or the file descriptor is not in the legal range of file descriptors.

EBUSY Device or resource busy
An attempt to mount a device that was already mounted or an attempt was made to dismount a device on which there is an active file (open file, current directory, mounted-on file, active text segment). It will also occur if an attempt is made to enable accounting when it is already enabled. The device or resource is currently unavailable, such as when a non-shareable device file is in use.

ECHILD No child processes
A wait was executed by a process that had no existing or unwaited-for child processes. 

ECONNABORTED
Software caused connection abort
A connection abort was caused internal to your host machine.

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.

ECONNRESET Connection reset by peer
A connection was forcibly closed by a peer.  This normally results from the peer executing a shutdown(2) call. 

EDEADLK Resource deadlock would occur
A process which has locked a system resource would have been put to sleep while attempting to access another process’ locked resource.

EDESTADDRREQ
Destination address required
A required address was omitted from an operation on a socket.

EDOM Math argument
The argument of a function in the math package (3M) is out of the domain of the function.

EEXIST File exists
An existing file was mentioned in an inappropriate context, e.g., link.

EFAULT Bad address
The system encountered a hardware fault in attempting to use an argument of a system call; can also result from passing the wrong number of parameters to a system call. The reliable detection of this error will be implementation dependent.

EFBIG File too large
The size of a file exceeded the maximum file size (for the file system) or ULIMIT was exceeded (see ulimit(2)), or a bad semaphore number in a semop(2) call.

EHOSTDOWN Host is down
A socket operation encountered a dead host. Networking activity on the local host has not been intiated.

EHOSTUNREACH
No route to host
A socket operation was attempted to an unreachable host.

EIDRM Identifier Removed
This error is returned to processes that resume execution due to the removal of an identifier from the file system’s name space (see msgctl(2), semctl(2), and shmctl(2)).

EINPROGRESS Operation now in progress
An operation which takes a long time to complete was attempted on a non-blocking object (see ioctl(2) and fcntl(2)). 

EINTR Interrupted system call
An asynchronous signal (such as interrupt or quit), which the user has elected to catch, occurred during a system call. If execution is resumed after processing the signal, it will appear as if the interrupted system call returned this error condition unless the system call is restarted (see sigvector(2)). 

EINVAL Invalid argument
Some invalid argument (e.g., dismounting a non-mounted device; mentioning an undefined signal in signal, or kill; reading or writing a file for which lseek has generated a negative pointer).  Also set by the math functions described in the (3M) entries of this manual. 

EIO I/O error
Some physical I/O error. This error may in some cases occur on a call following the one to which it actually applies.

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. 

EISDIR Is a directory
An attempt to open a directory for writing.

EMFILE Too many open files
No process may have more than a system defined number of file descriptors open at a time.

EMLINK Too many links
An attempt to make more than the maximum number of links to a file.

EMSGSIZE Message too long
The socket requires that the message be sent atomically, and the size of the message to be sent made this impossible.

ENAMETOOLONG
File name too long
A path specified exceeds the maximum path length for the system.  The maximum path length is specified by MAXPATHLEN and is kept in <sys/param.h>.  If this MAXPATHLEN is not defined for an implementation, that implementation does not generate this error.  MAXPATHLEN is guaranteed to be at least 1023 characters.

ENET Local area network error
An error occurred in the software or hardware associated with your local area network.

ENETDOWN Network is down
A socket operation encountered a dead network.

ENETRESET Network dropped connection on reset
The host you were connected to crashed and rebooted.

ENETUNREACH
Network is unreachable
A socket operation was attempted to an unreachable network.

ENFILE File table overflow
The system’s table of open files is full, and temporarily no more opens can be accepted. 

ENOBUFS No buffer space available
An operation on a socket was not performed because the system lacked sufficient buffer space.

ENODEV No such device
An attempt was made to apply an inappropriate system call to a device; e.g., read a write-only device.

ENOENT No such file or directory
This error occurs when a file name is specified and the file should exist but doesn’t, or when one of the directories in a path name does not exist. It also occurs with msgget, semget, shmget when key does not refer to any object and the IPC_CREAT flag is not set. 

ENOEXEC Exec format error
A request is made to execute a file which, although it has the appropriate permissions, does not start with a valid magic number (see a.out(4)), or the file is too small to have a valid executable file header.

ENOMEM Not enough space
During a system call such as exec, brk, fork, or sbrk, a program asks for more space than the system is able to supply. This may not be a temporary condition; the maximum space size is a system parameter. The error may also occur if the arrangement of text, data, and stack segments requires too many segmentation registers, or if there is not enough swap space during a fork.

ENOMSG No message of desired type
An attempt was made to receive a message of a type that does not exist on the specified message queue; see msgop(2).

ENOPROTOOPT
Protocol not available
A bad option was specified in a getsockopt(2) or setsockopt(2) call.

ENOSPC No space left on device
During a write to an ordinary file, there is no free space left on the device; or, no space in system table during msgget(2), semget(2), or semop(2) while SEM_UNDO flag is set. 

ENOTBLK Block device required
A non-block file was mentioned where a block device was required, e.g., in mount.

ENOTCONN Socket is not connected
An request to send or receive data was disallowed because

ENOTDIR Not a directory
A non-directory was specified where a directory is required, for example in a path prefix or as an argument to chdir(2).

ENOTEMPTY Directory not empty
An attempt was made to remove a non-empty directory.

ENOTSOCK Socket operation on non-socket
An operation was attempted on something that is not a socket.

ENOTTY Not a typewriter
The (ioctl(2)) command is inappropriate to the selected device type.

ENXIO No such device or address
I/O on a special file refers to a subdevice which does not exist, or beyond the limits of the device. It may also occur when, for example, a tape drive is not online or no disk pack is loaded on a drive.

EOPNOTSUPP Operation not supported on socket
For example, trying to accept a connection on a datagram socket. 

EPERM Not owner
Typically this error indicates an attempt to modify a file in some way forbidden except to its owner or super-user. It is also returned for attempts by ordinary users to do things allowed only to the super-user.

EPFNOSUPPORT
Protocol family not supported
The protocol family has not been configured into the system or no implementation for it exists. the socket is not connected.

EPIPE Broken pipe
A write on a pipe for which there is no process to read the data. This condition normally generates a signal; the error is returned if the signal is ignored.

EPROTONOSUPPORT
Protocol not supported
The protocol has not been configured into the system or no implementation for it exists.

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.

ERANGE Result too large
The value of a function in the math package (3M) is not representable within machine precision, or a semop(2) call would cause either a semaphore value or a semaphore adjust value to exceed it system-imposed maximum.

EROFS Read-only file system
An attempt to modify a file or directory was made on a device mounted read-only.

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(2) call.

ESOCKTNOSUPPORT
Socket type not supported
The support for the socket type has not been configured into the system or no implementation for it exists.

ESPIPE Illegal seek
An lseek was issued to a pipe. 

ESRCH No such process
No process can be found corresponding to that specified by pid in kill, rtprio or ptrace, or the process is not accessible.

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.) 

ETXTBSY Text file busy
An attempt to execute an executable file which is currently open for writing (or reading). Also, an attempt to open for writing an otherwise writable file which is currently open for execution.

EWOULDBLOCK
Operation would block
An operation which would cause a process to block was attempted on a object in non-blocking mode (see ioctl(2) and fcntl(2)). 

EXDEV Cross-device link
A link to a file on another device was attempted.

HARDWARE DEPENDENCIES

Series 500:
In the definition of error 12 (ENOMEM), the maximum space size is not a system parameter.  Also, the terms “text, data, and stack segments”, “segmentation registers”, and “swap space” are invalid. 

In the definition of error 31 (EMLINK), the maximum number of links is 32767. 

This additional errno value is implemented:

EUNEXPECT Unexpected error
An unexpected error was returned from the system, indicating some type of system problem.  This error should never occur; if it does, it indicates a system bug.

A second error indicator, errinfo, is implemented in addition to errno. 

Series 800:
In the definition of error ENOMEM, the term “segmentation registers” is invalid. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026