-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy patherrors.h
75 lines (70 loc) · 2.67 KB
/
errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//Legacy errors
enum
{
ENOTHING, // No Error
EACCES, // Permission denied
EEXIST, // File exists
EINTR, // Interrupted system call
EINVAL, // Invalid argument
EIO, // I/O error
EISDIR, // Is a directory
ELOOP, // Symbolic link chain too deep
EMFILE, // Too many open files
ENAMETOOLONG, // File or path name too long
ENFILE, // Too many open files in system
ENOENT, // No such file or directory
ENOSR, // Out of stream resources
ENOSPC, // No space left on device
ENOTDIR, // Not a directory
ENXIO, // No such device or address
EOVERFLOW, // Value too large for defined data type
EROFS, // Read only file system
EAGAIN, // No more processes
ENOMEM, // Not enough memory
ETXTBUSY, // Text file busy
EBADF, // Bad file descriptor
ESPIPE, // Illegal seek
EIEIO, // Computer bought the farm
ENOTSUP, // Operation not supported
EXDEV, // Cross device operation not supported
EBUSY, // Resource is busy
ENOTEMPTY, // Directory is not empty
ENOTTY, // Invalid input/output control request
ERANGE, // Range error
EDOM, // Domain error
ECOUNT,
};
#define ERR_NOTHING (-ENOTHING)
#define ERR_SUCCESS (-ENOTHING)
#define ERR_ACCESS_DENIED (-EACCES)
#define ERR_FILE_EXISTS (-EEXIST)
#define ERR_INTERRUPTED (-EINTR)
#define ERR_INVALID_PARM (-EINVAL)
#define ERR_IO_ERROR (-EIO)
#define ERR_IS_DIRECTORY (-EISDIR)
#define ERR_TOO_MANY_SYMLINKS (-ELOOP)
#define ERR_TOO_MANY_OPEN_FILES (-EMFILE)
#define ERR_NAME_TOO_LONG (-ENAMETOOLONG)
#define ERR_TOO_MANY_OPEN_FILES_S (-ENFILE)
#define ERR_NO_FILE (-ENOENT)
#define ERR_NO_STREAM_RESOURCES (-ENOSR)
#define ERR_NO_SPACE_LEFT (-ENOSPC)
#define ERR_NOT_DIRECTORY (-ENOTDIR)
#define ERR_NO_SUCH_DEVICE (-ENXIO)
#define ERR_OVERFLOW (-EOVERFLOW)
#define ERR_READ_ONLY_FS (-EROFS)
#define ERR_NO_MORE_PROCESSES (-EAGAIN)
#define ERR_NO_MEMORY (-ENOMEM)
#define ERR_TEXT_FILE_BUSY (-ETXTBUSY)
#define ERR_BAD_FILE_DES (-EBADF)
#define ERR_ILLEGAL_SEEK (-ESPIPE)
#define ERR_NOT_SUPPORTED (-ENOTSUP)
#define ERR_CROSS_DEVICE (-EXDEV)
enum
{
ERR_CANCELED = 0x8000002, ECANCELED = -ERR_CANCELED,
ERR_FILE_TOO_BIG = 0x8000003, EFBIG = -ERR_FILE_TOO_BIG,
};
#define SUCCEEDED(ReturnValue) ((ReturnValue) >= 0)
#define FAILED(ReturnValue) ((ReturnValue) < 0)
const char *GetErrNoString(int errno);