Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > E

errno(2)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

errno — error indicator for function calls

SYNOPSIS

#include <errno.h>

DESCRIPTION

Many functions in the HP-UX operating system indicate an error condition by returning an otherwise out-of-range value (usually -1). Most of these functions set the symbol errno, that is defined in errno.h, to a nonzero code value that more specifically identifies the particular error condition that was encountered.

In most cases, the manpages for functions that set errno list those errno values and error descriptions in the ERRORS section of the manpages. However, failures in underlying functions, subsystems, and applications may return errno values that are not documented in the calling functions' manpages.

The value of errno is zero immediately after a successful call to any of the functions described by exec(2), but it is never set to zero by any other HP-UX function. Functions for which the use of errno is not described may nevertheless change its value to a nonzero value.

Since errno is not cleared on successful function calls, its value should be checked or used only when an error has been indicated and when the function's ERRORS section documents the error codes.

Applications should not attempt to take the address of errno. The practice of defining errno as extern int errno is obsolescent.

The following is a complete list of the error codes. The numeric values can be found in <errno.h> but they should not be used in an application program because they can vary from system to system.

[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]

Cannot 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]

Resource temporarily unavailable. This is likely a temporary condition, and later calls to the same routine may complete normally.

[EALREADY]

Operation already in progress. An operation was attempted on a nonblocking 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 nonsharable 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() call (see shutdown(2)).

[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 is 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() call (see semop(2)).

[EHOSTDOWN]

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

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

[EILSEQ]

Illegal byte sequence. A wide character code has been detected that does not correspond to a valid character, or a byte sequence does not form a valid wide character code.

[EINPROGRESS]

Operation now in progress. An operation that takes a long time to complete was attempted on a nonblocking 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 signal(5)).

[EINVAL]

Invalid argument. Some invalid argument (such as unmounting a device that is not currently mounted, mentioning an undefined signal in signal() or kill(), or 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.

[ELOOP]

Too many levels of symbolic links were encountered while resolving a path name. See fs_symlinks(5) for more information.

[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 PATH_MAX and is defined in <limits.h>. PATH_MAX is guaranteed to be at least 1023 bytes. This error is also generated if the length of a path name component exceeds NAME_MAX and the _POSIX_NO_TRUNC option is in effect for the specified path. Currently, _POSIX_NO_TRUNC is in effect only for HFS file systems configured to allow path name components up to 255 bytes long (see convertfs(1M)) and therefore only path names referring to such file systems can generate the error for this case. The values of NAME_MAX, PATH_MAX, and _POSIX_NO_TRUNC for a particular path name can be queried by using the pathconf() system call (see pathconf(2)).

[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 open()s 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 (such as 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 does not, or when one of the directories in a path name does not exist. It also occurs with msgget(), semget(), and 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.

[ENOLCK]

System lock table is full. Too many files have file locks on them, or there are too many record locks on files, or there are too many instances of a reading or writing process sleeping until an enforcement mode lock clears. This error may also indicate system problems in handling a lock request on a remote NFS file. This error is also currently returned for all attempts to perform locking operations on a remote NFS file that has its locking enforcement mode bit set, since the stateless nature of NFS prevents maintaining the necessary lock information.

[ENOLINK]

No connection. The link with the device has been severed or disconnected.

[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 can also occur 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 option not available. This may be returned for a getsockopt() or setsockopt() call (see getsockopt(2)) if the user specified an option that the local system does not support or for any system call that causes the local system to send a network protocol option that a remote system does not support, including a system call that operates on an NFS file.

[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(), semget(), or semop() while SEM_UNDO flag is set.

[ENOSYM]

Symbol does not exist in executable. The dynamic loader was unable to resolve a symbolic reference in a shared library during a call to one of the dynamic loader interface routines (see shl_load(3X). The program may be in an inconsistent state and should be terminated immediately.

[ENOSYS]

Function is not available. The requested function or operation is not implemented or not configured in the system.

[ENOTBLK]

Block device required. A nonblock file was mentioned where a block device was required, such as in mount().

[ENOTCONN]

Socket is not connected. A request to send or receive data was disallowed because the socket was not connected.

[ENOTDIR]

Not a directory. A nondirectory was specified where a directory is required, such as in a path prefix or as an argument to chdir().

[ENOTEMPTY]

Directory not empty. An attempt was made to remove a nonempty directory.

[ENOTSOCK]

Socket operation on nonsocket. An operation was attempted on something that is not a socket.

[ENOTTY]

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

[ENXIO]

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

[EOPNOTSUPP]

Operation not supported. The requested operation on a socket or NFS file is either invalid or unsupported. For example, this might occur when an attempt to accept() a connection on a datagram socket fails.

[EPERM]

Not owner. Typically, this error indicates an attempt to modify a file in some way forbidden except to its owner or the superuser, such as to change its mode. It is also returned for attempts by ordinary users to do things for which they need, but lack, a special privilege.

[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. Data has been written to a pipe for which the other (reading) end has been closed. This most often occurs when the reading process exits before the writing process. This condition also generates the signal SIGPIPE; 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, ARPA Internet UDP protocol cannot be used 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() 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() 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() or rtprio(), 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 (timeout period varies, depending 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 an object in nonblocking mode (see ioctl(2) and fcntl(2)).

[EXDEV]

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

DEPENDENCIES

The following NFS errors are also defined:

[EREFUSED]

The same error as ECONNREFUSED. The external variable errno is defined as ECONNREFUSED for NFS compatibility.

[EREMOTE]

Too many levels of remote in path. An attempt was made to remotely mount an NFS file system into a path which already has a remotely mounted NFS file system component.

[ESTALE]

Stale NFS file handle. A client referenced an open file, but the file was previously deleted.

STANDARDS CONFORMANCE

errno: AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.