Open Error Codes Linux
Contents |
Aug 2004 on RedHat 7.3 #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO
Errno Linux
5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define linux errno list E2BIG 7 /* Arg list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */
Errno Values Linux
#define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ #define EACCES 13 /* Permission denied */ #define EFAULT 14 /* Bad address */ #define ENOTBLK 15 linux error numbers /* Block device required */ #define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */ #define EXDEV 18 /* Cross-device link */ #define ENODEV 19 /* No such device */ #define ENOTDIR 20 /* Not a directory */ #define EISDIR 21 /* Is a directory */ #define EINVAL 22 /* Invalid argument */ #define ENFILE 23 /* File table overflow */ #define EMFILE 24 /* Too many open files */ #define ENOTTY 25 linux exit codes /* Not a typewriter */ #define ETXTBSY 26 /* Text file busy */ #define EFBIG 27 /* File too large */ #define ENOSPC 28 /* No space left on device */ #define ESPIPE 29 /* Illegal seek */ #define EROFS 30 /* Read-only file system */ #define EMLINK 31 /* Too many links */ #define EPIPE 32 /* Broken pipe */ #define EDOM 33 /* Math argument out of domain of func */ #define ERANGE 34 /* Math result not representable */ #define EDEADLK 35 /* Resource deadlock would occur */ #define ENAMETOOLONG 36 /* File name too long */ #define ENOLCK 37 /* No record locks available */ #define ENOSYS 38 /* Function not implemented */ #define ENOTEMPTY 39 /* Directory not empty */ #define ELOOP 40 /* Too many symbolic links encountered */ #define EWOULDBLOCK EAGAIN /* Operation would block */ #define ENOMSG 42 /* No message of desired type */ #define EIDRM 43 /* Identifier removed */ #define ECHRNG 44 /* Channel number out of range */ #define EL2NSYNC 45 /* Level 2 not synchronized */ #define EL3HLT 46 /* Level 3 halted */ #define EL3RST 47 /* Level 3 reset */ #define ELNRNG 48 /* Link number out of range */ #define EUNATCH 49 /* Protocol driver not attached */ #define ENOCSI 50 /* No CSI structure available */ #define EL2HLT 51 /* Level 2 halted */ #define EBADE 52 /* Invalid ex
top open, openat, creat - open and possibly create a file SYNOPSIS top
Linux Error Messages
#include
Unix Error Codes
const char *pathname, int flags); int openat(int dirfd, const char *pathname, int flags, mode_t mode); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): openat(): Since glibc 2.10: _POSIX_C_SOURCE http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html >= 200809L Before glibc 2.10: _ATFILE_SOURCE DESCRIPTION top Given a pathname for a file, open() returns a file descriptor, a small, nonnegative integer for use in subsequent system calls (read(2), write(2), lseek(2), fcntl(2), etc.). The file descriptor returned by a successful call will be the lowest-numbered file descriptor not currently open for http://man7.org/linux/man-pages/man2/open.2.html the process. By default, the new file descriptor is set to remain open across an execve(2) (i.e., the FD_CLOEXEC file descriptor flag described in fcntl(2) is initially disabled); the O_CLOEXEC flag, described below, can be used to change this default. The file offset is set to the beginning of the file (see lseek(2)). A call to open() creates a new open file description, an entry in the system-wide table of open files. The open file description records the file offset and the file status flags (see below). A file descriptor is a reference to an open file description; this reference is unaffected if pathname is subsequently removed or modified to refer to a different file. For further details on open file descriptions, see NOTES. The argument flags must include one of the following access modes: O_RDONLY, O_WRONLY, or O_RDWR. These request opening the file read- only, write-only, or read/write, respectively. In addition, zero or more file creation flags and file status flags can be bitwise-or'd in flags. The
codes can’t occur on GNU systems, but they can occur using the GNU C Library on other systems. Macro: int EPERM Operation not permitted; only the owner of the file (or other resource) or processes with special privileges can http://www.gnu.org/s/libc/manual/html_node/Error-Codes.html perform the operation. Macro: int ENOENT No such file or directory. This is a “file doesn’t exist” error for ordinary files that are referenced in contexts where they are expected to already exist. Macro: int ESRCH No process matches the specified process ID. Macro: int EINTR Interrupted function call; an asynchronous signal occurred and prevented completion of the call. When this happens, you should try the call again. You can choose to have functions resume error codes after a signal that is handled, rather than failing with EINTR; see Interrupted Primitives. Macro: int EIO Input/output error; usually used for physical read or write errors. Macro: int ENXIO No such device or address. The system tried to use the device represented by a file you specified, and it couldn’t find the device. This can mean that the device file was installed incorrectly, or that the physical device is missing or not correctly attached to open error codes the computer. Macro: int E2BIG Argument list too long; used when the arguments passed to a new program being executed with one of the exec functions (see Executing a File) occupy too much memory space. This condition never arises on GNU/Hurd systems. Macro: int ENOEXEC Invalid executable file format. This condition is detected by the exec functions; see Executing a File. Macro: int EBADF Bad file descriptor; for example, I/O on a descriptor that has been closed or reading from a descriptor open only for writing (or vice versa). Macro: int ECHILD There are no child processes. This error happens on operations that are supposed to manipulate child processes, when there aren’t any processes to manipulate. Macro: int EDEADLK Deadlock avoided; allocating a system resource would have resulted in a deadlock situation. The system does not guarantee that it will notice all such situations. This error means you got lucky and the system noticed; it might just hang. See File Locks, for an example. Macro: int ENOMEM No memory available. The system cannot allocate more virtual memory because its capacity is full. Macro: int EACCES Permission denied; the file permissions do not allow the attempted operation. Macro: int EFAULT Bad address; an invalid pointer was detected. On GNU/Hurd systems, this error never happens; you get a signal instead. Macro: int ENOTBLK A file that isn&rsq