Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
errno.h
Go to the documentation of this file.
1 
4 #ifndef __ERRNO_H__
5 #define __ERRNO_H__
6 
7 /* The system calls report a failure by returning a negative error number, but
8  * the standard library reports one through this variable, and that is where a
9  * program that was not written for Tenok looks.
10  *
11  * It lives in the reentrancy structure of the C library, of which Tenok keeps
12  * a single one: two threads that fail at the same time overwrite each other.
13  */
14 #ifndef errno
15 extern int *__errno(void);
16 #define errno (*__errno())
17 #endif
18 
19 #define EPERM 1
20 #define ENOENT 2
21 #define ESRCH 3
22 #define EINTR 4
23 #define EIO 5
24 #define ENXIO 6
25 #define E2BIG 7
26 #define EBADF 9
27 #define EAGAIN 11
28 #define ENOMEM 12
29 #define EACCES 13
30 #define EFAULT 14
31 #define ENOTBLK 15
32 #define EBUSY 16
33 #define EEXIST 17
34 #define EXDEV 18
35 #define ENODEV 19
36 #define ENOTDIR 20
37 #define EISDIR 21
38 #define EINVAL 22
39 #define ENFILE 23
40 #define EMFILE 24
41 #define ENOTTY 25
42 #define ETXTBSY 26
43 #define EFBIG 27
44 #define ENOSPC 28
45 #define ESPIPE 29
46 #define EROFS 30
47 #define EPIPE 32
48 #define EDEADLK 45
49 #define ENOSYS 88
50 #define ENOTEMPTY 90
51 #define ENAMETOOLONG 91
52 #define ETIMEDOUT 116
53 #define EMSGSIZE 122
54 #define EOVERFLOW 139
56 /* Numbers Tenok never returns of its own. They are named so that a program
57  * written for a POSIX system compiles, and they follow newlib, which is the
58  * library the numbers have to agree with
59  */
60 #define ENOEXEC 8
61 #define ECHILD 10
62 #define ERANGE 34
63 #define ELOOP 92
64 #define ENOTSUP 134
66 #endif