errno.2 (2010 09)
e
errno(2) errno(2)
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 forbid-
den 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 una-
vailable, 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.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1