ERRNO(2)
NAME
errno − error indicator for system calls
SYNOPSIS
#include <errno.h>
extern int errno;
HP-UX COMPATIBILITY
Level: HP-UX/RUN ONLY
Origin: System V, HP
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 <sys/errno.h> but should not normally be used.
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.
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.
ESRCH No such process
No process can be found corresponding to that specified by pid in kill, ptrace, or rtprio, or the process is not accessible.
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)).
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.
ENXIO No such device or address
I/O on a special file refers to a subdevice which does not exist, or is beyond the limits of the device. It may also occur when, for example, a tape drive is not on-line or no disk pack is loaded on a drive, or when a read or write is attempted beyond the physical limit of a device.
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).
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(5)), or the file is too small to have a valid executable file header.
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.
ECHILD No child processes
A wait was executed by a process that had no existing or unwaited-for child processes.
EAGAIN No more processes
A fork failed because the system’s process table is full, the user is not allowed to create any more processes, or a semop or msgop call would have to block.
ENOMEM Not enough space
During an exec, brk, sbrk, shmget, shmctl, or plock system call, 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.
EACCES Permission denied
An attempt was made to access a file or IPC object in a way forbidden by the protection system.
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.
ENOTBLK Block device required
A non-block file was mentioned where a block device was required, e.g., in mount.
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.
EEXIST File exists
An existing file was mentioned in an inappropriate context, e.g., link.
EXDEV Cross-device link
A link to a file on another device was attempted.
ENODEV No such device
An attempt was made to apply an inappropriate system call to a device; e.g., read a write-only device.
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).
EISDIR Is a directory
An attempt to open a directory for writing.
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.
ENFILE File table overflow
The system’s table of open files is full, and temporarily no more opens can be accepted.
EMFILE Too many open files
No process may have more than a system defined number of file descriptors open at a time. For systems below HP−UX STANDARD the minimum number is 20. For systems at or above HP−UX STANDARD the minimum number is 60.
ENOTTY Not a typewriter
The (ioctl(2)) command is inappropriate to the selected device type.
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.
EFBIG File too large
The size of a file exceeded the maximum file size allowed by the file system, ULIMIT; was exceeded (see ulimit(2)), or bad semaphore number in semop(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), shmget(2), or semop(2) while SEM_UNDO flag is set.
ESPIPE Illegal seek
An lseek was issued to a pipe.
EROFS Read-only file system
An attempt to modify a file or directory was made on a device mounted read-only.
EMLINK Too many links
An attempt to make more than the maximum number of links (1000) to a file.
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.
EDOM Math argument
The argument of a function in the math package (3M) is out of the domain of the function.
ERANGE Result too large
The value of a function in the math package (3M) is not representable within machine precision.
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).
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)).
ENAMETOOLONG File name too long
A component of a path name exceeded the maximum number of characters for a file name, or an entire path name exceeded 1023 characters. Not all file systems always detect this error.
ENOTEMPTY Directory not empty
An attempt was made to remove a non-empty directory.
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.
ENET Local area network error
An error occured in the software or hardware associated with your local area network.
HARDWARE DEPENDENCIES
Series 500:
In the definition of 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 EMLINK, the maximum number of links is 32767. One additional errno values 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. See errinfo(2).
SEE ALSO
On the Series 500: err(1), errinfo(2).
Hewlett-Packard — last mod. May 11, 2021