mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:47:44 +00:00
Kernel+LibC: Turn errno codes into a strongly typed enum
..and allow implicit creation of KResult and KResultOr from ErrnoCode. This means that kernel functions that return those types can finally do "return EINVAL;" and it will just work. There's a handful of functions that still deal with signed integers that should be converted to return KResults.
This commit is contained in:
parent
e279b45aed
commit
19d3f8cab7
48 changed files with 591 additions and 506 deletions
|
@ -26,78 +26,155 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define EPERM 1
|
||||
#define ENOENT 2
|
||||
#define ESRCH 3
|
||||
#define EINTR 4
|
||||
#define EIO 5
|
||||
#define ENXIO 6
|
||||
#define E2BIG 7
|
||||
#define ENOEXEC 8
|
||||
#define EBADF 9
|
||||
#define ECHILD 10
|
||||
#define EAGAIN 11
|
||||
#define ENOMEM 12
|
||||
#define EACCES 13
|
||||
#define EFAULT 14
|
||||
#define ENOTBLK 15
|
||||
#define EBUSY 16
|
||||
#define EEXIST 17
|
||||
#define EXDEV 18
|
||||
#define ENODEV 19
|
||||
#define ENOTDIR 20
|
||||
#define EISDIR 21
|
||||
#define EINVAL 22
|
||||
#define ENFILE 23
|
||||
#define EMFILE 24
|
||||
#define ENOTTY 25
|
||||
#define ETXTBSY 26
|
||||
#define EFBIG 27
|
||||
#define ENOSPC 28
|
||||
#define ESPIPE 29
|
||||
#define EROFS 30
|
||||
#define EMLINK 31
|
||||
#define EPIPE 32
|
||||
#define ERANGE 33
|
||||
#define ENAMETOOLONG 34
|
||||
#define ELOOP 35
|
||||
#define EOVERFLOW 36
|
||||
#define EOPNOTSUPP 37
|
||||
#define ENOSYS 38
|
||||
#define ENOTIMPL 39
|
||||
#define EAFNOSUPPORT 40
|
||||
#define ENOTSOCK 41
|
||||
#define EADDRINUSE 42
|
||||
#define EWHYTHO 43
|
||||
#define ENOTEMPTY 44
|
||||
#define EDOM 45
|
||||
#define ECONNREFUSED 46
|
||||
#define EADDRNOTAVAIL 47
|
||||
#define EISCONN 48
|
||||
#define ECONNABORTED 49
|
||||
#define EALREADY 50
|
||||
#define ECONNRESET 51
|
||||
#define EDESTADDRREQ 52
|
||||
#define EHOSTUNREACH 53
|
||||
#define EILSEQ 54
|
||||
#define EMSGSIZE 55
|
||||
#define ENETDOWN 56
|
||||
#define ENETUNREACH 57
|
||||
#define ENETRESET 58
|
||||
#define ENOBUFS 59
|
||||
#define ENOLCK 60
|
||||
#define ENOMSG 61
|
||||
#define ENOPROTOOPT 62
|
||||
#define ENOTCONN 63
|
||||
#define EWOULDBLOCK 64
|
||||
#define EPROTONOSUPPORT 65
|
||||
#define EDEADLK 66
|
||||
#define ETIMEDOUT 67
|
||||
#define EPROTOTYPE 68
|
||||
#define EINPROGRESS 69
|
||||
#define ENOTHREAD 70
|
||||
#define EPROTO 71
|
||||
#define ENOTSUP 72
|
||||
#define EPFNOSUPPORT 73
|
||||
#define EDIRINTOSELF 74
|
||||
#define EMAXERRNO 75
|
||||
enum ErrnoCode {
|
||||
EPERM = 1,
|
||||
#define EPERM EPERM
|
||||
ENOENT,
|
||||
#define ENOENT ENOENT
|
||||
ESRCH,
|
||||
#define ESRCH ESRCH
|
||||
EINTR,
|
||||
#define EINTR EINTR
|
||||
EIO,
|
||||
#define EIO EIO
|
||||
ENXIO,
|
||||
#define ENXIO ENXIO
|
||||
E2BIG,
|
||||
#define E2BIG E2BIG
|
||||
ENOEXEC,
|
||||
#define ENOEXEC ENOEXEC
|
||||
EBADF,
|
||||
#define EBADF EBADF
|
||||
ECHILD,
|
||||
#define ECHILD ECHILD
|
||||
EAGAIN,
|
||||
#define EAGAIN EAGAIN
|
||||
ENOMEM,
|
||||
#define ENOMEM ENOMEM
|
||||
EACCES,
|
||||
#define EACCES EACCES
|
||||
EFAULT,
|
||||
#define EFAULT EFAULT
|
||||
ENOTBLK,
|
||||
#define ENOTBLK ENOTBLK
|
||||
EBUSY,
|
||||
#define EBUSY EBUSY
|
||||
EEXIST,
|
||||
#define EEXIST EEXIST
|
||||
EXDEV,
|
||||
#define EXDEV EXDEV
|
||||
ENODEV,
|
||||
#define ENODEV ENODEV
|
||||
ENOTDIR,
|
||||
#define ENOTDIR ENOTDIR
|
||||
EISDIR,
|
||||
#define EISDIR EISDIR
|
||||
EINVAL,
|
||||
#define EINVAL EINVAL
|
||||
ENFILE,
|
||||
#define ENFILE ENFILE
|
||||
EMFILE,
|
||||
#define EMFILE EMFILE
|
||||
ENOTTY,
|
||||
#define ENOTTY ENOTTY
|
||||
ETXTBSY,
|
||||
#define ETXTBSY ETXTBSY
|
||||
EFBIG,
|
||||
#define EFBIG EFBIG
|
||||
ENOSPC,
|
||||
#define ENOSPC ENOSPC
|
||||
ESPIPE,
|
||||
#define ESPIPE ESPIPE
|
||||
EROFS,
|
||||
#define EROFS EROFS
|
||||
EMLINK,
|
||||
#define EMLINK EMLINK
|
||||
EPIPE,
|
||||
#define EPIPE EPIPE
|
||||
ERANGE,
|
||||
#define ERANGE ERANGE
|
||||
ENAMETOOLONG,
|
||||
#define ENAMETOOLONG ENAMETOOLONG
|
||||
ELOOP,
|
||||
#define ELOOP ELOOP
|
||||
EOVERFLOW,
|
||||
#define EOVERFLOW EOVERFLOW
|
||||
EOPNOTSUPP,
|
||||
#define EOPNOTSUPP EOPNOTSUPP
|
||||
ENOSYS,
|
||||
#define ENOSYS ENOSYS
|
||||
ENOTIMPL,
|
||||
#define ENOTIMPL ENOTIMPL
|
||||
EAFNOSUPPORT,
|
||||
#define EAFNOSUPPORT EAFNOSUPPORT
|
||||
ENOTSOCK,
|
||||
#define ENOTSOCK ENOTSOCK
|
||||
EADDRINUSE,
|
||||
#define EADDRINUSE EADDRINUSE
|
||||
EWHYTHO,
|
||||
#define EWHYTHO EWHYTHO
|
||||
ENOTEMPTY,
|
||||
#define ENOTEMPTY ENOTEMPTY
|
||||
EDOM,
|
||||
#define EDOM EDOM
|
||||
ECONNREFUSED,
|
||||
#define ECONNREFUSED ECONNREFUSED
|
||||
EADDRNOTAVAIL,
|
||||
#define EADDRNOTAVAIL EADDRNOTAVAIL
|
||||
EISCONN,
|
||||
#define EISCONN EISCONN
|
||||
ECONNABORTED,
|
||||
#define ECONNABORTED ECONNABORTED
|
||||
EALREADY,
|
||||
#define EALREADY EALREADY
|
||||
ECONNRESET,
|
||||
#define ECONNRESET ECONNRESET
|
||||
EDESTADDRREQ,
|
||||
#define EDESTADDRREQ EDESTADDRREQ
|
||||
EHOSTUNREACH,
|
||||
#define EHOSTUNREACH EHOSTUNREACH
|
||||
EILSEQ,
|
||||
#define EILSEQ EILSEQ
|
||||
EMSGSIZE,
|
||||
#define EMSGSIZE EMSGSIZE
|
||||
ENETDOWN,
|
||||
#define ENETDOWN ENETDOWN
|
||||
ENETUNREACH,
|
||||
#define ENETUNREACH ENETUNREACH
|
||||
ENETRESET,
|
||||
#define ENETRESET ENETRESET
|
||||
ENOBUFS,
|
||||
#define ENOBUFS ENOBUFS
|
||||
ENOLCK,
|
||||
#define ENOLCK ENOLCK
|
||||
ENOMSG,
|
||||
#define ENOMSG ENOMSG
|
||||
ENOPROTOOPT,
|
||||
#define ENOPROTOOPT ENOPROTOOPT
|
||||
ENOTCONN,
|
||||
#define ENOTCONN ENOTCONN
|
||||
EWOULDBLOCK,
|
||||
#define EWOULDBLOCK EWOULDBLOCK
|
||||
EPROTONOSUPPORT,
|
||||
#define EPROTONOSUPPORT EPROTONOSUPPORT
|
||||
EDEADLK,
|
||||
#define EDEADLK EDEADLK
|
||||
ETIMEDOUT,
|
||||
#define ETIMEDOUT ETIMEDOUT
|
||||
EPROTOTYPE,
|
||||
#define EPROTOTYPE EPROTOTYPE
|
||||
EINPROGRESS,
|
||||
#define EINPROGRESS EINPROGRESS
|
||||
ENOTHREAD,
|
||||
#define ENOTHREAD ENOTHREAD
|
||||
EPROTO,
|
||||
#define EPROTO EPROTO
|
||||
ENOTSUP,
|
||||
#define ENOTSUP ENOTSUP
|
||||
EPFNOSUPPORT,
|
||||
#define EPFNOSUPPORT EPFNOSUPPORT
|
||||
EDIRINTOSELF,
|
||||
#define EDIRINTOSELF EDIRINTOSELF
|
||||
EMAXERRNO,
|
||||
#define EMAXERRNO EMAXERRNO
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue