The Pedigree Project 0.1
errors.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef ERRORS_H
21#define ERRORS_H
22
23// This namespace is mapped to posix errno's where possible. Keep it that way!
24namespace Error {
25enum PosixError {
26 NoError = 0,
27 NotEnoughPermissions = 1, // EPERM
28 DoesNotExist = 2, // ENOENT
29 NoSuchProcess = 3, // ESRCH
30 Interrupted = 4, // EINTR
31 IoError = 5, // EIO
32 NoSuchDevice = 6, // ENXIO
33 TooBig = 7, // E2BIG
34 ExecFormatError = 8, // ENOEXEC
35 BadFileDescriptor = 9, // EBADF
36 NoChildren = 10, // ECHILD
37 NoMoreProcesses = 11, // EAGAIN
38 OutOfMemory = 12, // ENOMEM
39 PermissionDenied = 13, // EACCES
40 BadAddress = 14, // EFAULT
41 NotABlockDevice = 15, // ENOTBLK
42 DeviceBusy = 16, // EBUSY
43 FileExists = 17, // EEXIST
44 CrossDeviceLink = 18, // EXDEV
45 DeviceDoesNotExist = 19, // ENODEV
46 NotADirectory = 20, // ENOTDIR
47 IsADirectory = 21, // EISDIR
48 InvalidArgument = 22, // EINVAL
49 TooManyOpenFiles = 23, // ENFILE
50 ProcessFileLimit = 24, // EMFILE
51 NotAConsole = 25, // ENOTTY
52 TextFileBusy = 26, // ETXTBSY
53 FileTooLarge = 27, // EFBIG
54 NoSpaceLeftOnDevice = 28, // ENOSPC
55 IllegalSeek = 29, // ESPIPE (??)
56 ReadOnlyFilesystem = 30, // EROFS
57 TooManyLinks = 31, // EMLINK
58 BrokenPipe = 32, // EPIPE
59 BadRange = 34, // ERANGE
60 Deadlock = 35, // EDEADLK
61 NameTooLong = 36, // ENAMETOOLONG
62 NoLocksAvailable = 37, // ENOLCK
63 Unimplemented = 38, // ENOSYS
64 NotEmpty = 39, // ENOTEMPTY
65 LoopExists = 40, // ELOOP
66 NoMessage = 42, // ENOMSG
67 IdentifierRemoved = 43, // EIDRM
68 NoData = 61, // ENODATA
69 ValueTooLarge = 75, // EOVERFLOW
70 BadSharedLibrary = 80, // ELIBBAD
71 ProtocolWrongType = 91, // EPROTOTYPE
72 ProtocolNotAvailable = 92, // ENOPROTOOPT
73 OperationNotSupported = 95, // ENOTSUP
74 AddressInUse = 98, // EADDRINUSE
75 ConnectionAborted = 103, // ECONNABORTED
76 ConnectionReset = 104, // ECONNRESET
77 NoMoreBuffers = 105, // ENOBUFS
78 IsConnected = 106, // EISCONN
79 NotConnected = 107, // ENOTCONN
80 TooManyReferences = 109, // ETOOMANYREFS
81 TimedOut = 110, // ETIMEDOUT
82 ConnectionRefused = 111, // ECONNREFUSED
83 HostUnreachable = 113, // EHOSTUNREACH
84 Already = 114, // EALREADY
85 InProgress = 115, // EINPROGRESS
86 StaleFileHandle = 116, // ESTALE
87 QuotaExceeded = 122, // EDQUOT
88 Cancelled = 125, // ECANCELED
89};
90}
91
92#endif