16cd6a6acSopenharmony_ci/* Author: Karl MacMillan <kmacmillan@mentalrootkit.com> */
26cd6a6acSopenharmony_ci
36cd6a6acSopenharmony_ci#ifndef __sepol_errno_h__
46cd6a6acSopenharmony_ci#define __sepol_errno_h__
56cd6a6acSopenharmony_ci
66cd6a6acSopenharmony_ci#include <errno.h>
76cd6a6acSopenharmony_ci
86cd6a6acSopenharmony_ci#ifdef __cplusplus
96cd6a6acSopenharmony_ciextern "C" {
106cd6a6acSopenharmony_ci#endif
116cd6a6acSopenharmony_ci
126cd6a6acSopenharmony_ci#define SEPOL_OK             0
136cd6a6acSopenharmony_ci
146cd6a6acSopenharmony_ci/* These first error codes are defined for compatibility with
156cd6a6acSopenharmony_ci * previous version of libsepol. In the future, custom error
166cd6a6acSopenharmony_ci * codes that don't map to system error codes should be defined
176cd6a6acSopenharmony_ci * outside of the range of system error codes.
186cd6a6acSopenharmony_ci */
196cd6a6acSopenharmony_ci#define SEPOL_ERR            (-1)
206cd6a6acSopenharmony_ci#define SEPOL_ENOTSUP        (-2)  /* feature not supported in module language */
216cd6a6acSopenharmony_ci#define SEPOL_EREQ           (-3)  /* requirements not met */
226cd6a6acSopenharmony_ci
236cd6a6acSopenharmony_ci/* Error codes that map to system error codes */
246cd6a6acSopenharmony_ci#define SEPOL_ENOMEM         (-ENOMEM)
256cd6a6acSopenharmony_ci#define SEPOL_EEXIST         (-EEXIST)
266cd6a6acSopenharmony_ci#define SEPOL_ENOENT         (-ENOENT)
276cd6a6acSopenharmony_ci
286cd6a6acSopenharmony_ci#ifdef __cplusplus
296cd6a6acSopenharmony_ci}
306cd6a6acSopenharmony_ci#endif
316cd6a6acSopenharmony_ci
326cd6a6acSopenharmony_ci#endif
33