1/* Author: Karl MacMillan <kmacmillan@mentalrootkit.com> */
2
3#ifndef __sepol_errno_h__
4#define __sepol_errno_h__
5
6#include <errno.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#define SEPOL_OK             0
13
14/* These first error codes are defined for compatibility with
15 * previous version of libsepol. In the future, custom error
16 * codes that don't map to system error codes should be defined
17 * outside of the range of system error codes.
18 */
19#define SEPOL_ERR            (-1)
20#define SEPOL_ENOTSUP        (-2)  /* feature not supported in module language */
21#define SEPOL_EREQ           (-3)  /* requirements not met */
22
23/* Error codes that map to system error codes */
24#define SEPOL_ENOMEM         (-ENOMEM)
25#define SEPOL_EEXIST         (-EEXIST)
26#define SEPOL_ENOENT         (-ENOENT)
27
28#ifdef __cplusplus
29}
30#endif
31
32#endif
33