errno.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Copyright (C) 2021 Rain */
  2. /* This file is part of XNIX. */
  3. /*
  4. XNIX is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) and later version.
  8. */
  9. /*
  10. XNIX is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. */
  15. /*
  16. You should have received a copy of the GNU General Public License
  17. along with XNIX. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _ERRNO_H
  20. #define _ERRNO_H
  21. /* yeah, yeah, you know. this copies from linux 0.01 :-) */
  22. /* this is a real joke. */
  23. extern int errno;
  24. typedef int errno_t;
  25. #define ERROR 99
  26. #define EPERM 1
  27. #define ENOENT 2
  28. #define ESRCH 3
  29. #define EINTR 4
  30. #define EIO 5
  31. #define ENXIO 6
  32. #define E2BIG 7
  33. #define ENOEXEC 8
  34. #define EBADF 9
  35. #define ECHILD 10
  36. #define EAGAIN 11
  37. #define ENOMEM 12
  38. #define EACCES 13
  39. #define EFAULT 14
  40. #define ENOTBLK 15
  41. #define EBUSY 16
  42. #define EEXIST 17
  43. #define EXDEV 18
  44. #define ENODEV 19
  45. #define ENOTDIR 20
  46. #define EISDIR 21
  47. #define EINVAL 22
  48. #define ENFILE 23
  49. #define EMFILE 24
  50. #define ENOTTY 25
  51. #define ETXTBSY 26
  52. #define EFBIG 27
  53. #define ENOSPC 28
  54. #define ESPIPE 29
  55. #define EROFS 30
  56. #define EMLINK 31
  57. #define EPIPE 32
  58. #define EDOM 33
  59. #define ERANGE 34
  60. #define EDEADLK 35
  61. #define ENAMETOOLONG 36
  62. #define ENOLCK 37
  63. #define ENOSYS 38
  64. #define ENOTEMPTY 39
  65. #endif