318a95457ef92b3dd37034e1743175445a96777c
[akaros.git] / kern / include / ros / error.h
1 /* See COPYRIGHT for copyright information. */
2
3 #ifndef ROS_INC_ERROR_H
4 #define ROS_INC_ERROR_H
5
6 #include <ros/common.h>
7
8 #define DECLARE_ERROR_CODE(e, s)
9
10 // define this to prevent conflicts with newlib's errno.h
11 #define __error_t_defined
12 typedef enum {
13         ESUCCESS = 0,            // Success
14         EFAIL,                   // Generic Failure
15         EPERM,                   // Wrong permissions
16         EDEADLOCK,               // Would cause deadlock
17         EBUSY,                   // Currently busy, try again later
18         ENOMEM,                  // No memory available
19         ENOCACHE,                // No cache available
20         EINVAL,                  // Invalid arguments
21         EFAULT,                  // Segmentation fault
22         EBADENV,                 // Bad environment 
23         ENOFREEENV,              // No free environment
24         EUNSPECIFIED,            // Unspecified
25         EMORON,                  // Moron
26         NUMERRORS,               // Total number of error codes
27 } error_t;
28
29 /* 
30  * The special format for printk %e takes an integer 
31  * error code and prints a string describing the error.
32  * The integer may be positive or negative,
33  * so that -ENOMEM and ENOMEM are equivalent.
34  */
35
36 static const char *NTS const error_string[NUMERRORS] =
37 {
38         "Success",
39         "Generic Failure",
40         "Wrong permissions",
41         "Would cause deadlock",
42         "Currently busy, try again later",
43         "No memory available",
44         "No cache available",
45         "Invalid arguments",
46         "Segmentation fault",
47         "Bad environment",
48         "No free environment",
49         "You are a moron",
50         "Unspecified",
51 };
52
53 #endif  // !ROS_INC_ERROR_H */