aeaf950023ec073a7c64034bba49fd9ac6ac10f4
[gnulib.git] / lib / se-selinux.in.h
1 #ifndef SELINUX_SELINUX_H
2 # define SELINUX_SELINUX_H
3
4 # include <sys/types.h>
5 # include <errno.h>
6 /* Some systems don't have ENOTSUP.  */
7 # ifndef ENOTSUP
8 #  ifdef ENOSYS
9 #   define ENOTSUP ENOSYS
10 #  else
11 /* Some systems don't have ENOSYS either.  */
12 #   define ENOTSUP EINVAL
13 #  endif
14 # endif
15
16 typedef unsigned short security_class_t;
17 # define security_context_t char*
18 # define is_selinux_enabled() 0
19
20 static inline int getcon (security_context_t *con)
21   { errno = ENOTSUP; return -1; }
22 static inline void freecon (security_context_t con) {}
23
24
25 static inline int getfscreatecon (security_context_t *con)
26   { errno = ENOTSUP; return -1; }
27 static inline int setfscreatecon (security_context_t con)
28   { errno = ENOTSUP; return -1; }
29 static inline int matchpathcon (char const *s, mode_t m,
30                                 security_context_t *con)
31   { errno = ENOTSUP; return -1; }
32 static inline int getfilecon (char const *s, security_context_t *con)
33   { errno = ENOTSUP; return -1; }
34 static inline int lgetfilecon (char const *s, security_context_t *con)
35   { errno = ENOTSUP; return -1; }
36 static inline int setfilecon (char const *s, security_context_t con)
37   { errno = ENOTSUP; return -1; }
38 static inline int lsetfilecon (char const *s, security_context_t con)
39   { errno = ENOTSUP; return -1; }
40 static inline int fsetfilecon (int fd, security_context_t con)
41   { errno = ENOTSUP; return -1; }
42
43 static inline int security_check_context (security_context_t con)
44   { errno = ENOTSUP; return -1; }
45 static inline int security_check_context_raw (security_context_t con)
46   { errno = ENOTSUP; return -1; }
47 static inline int setexeccon (security_context_t con)
48   { errno = ENOTSUP; return -1; }
49 static inline int security_compute_create (security_context_t scon,
50                                            security_context_t tcon,
51                                            security_class_t tclass,
52                                            security_context_t *newcon)
53   { errno = ENOTSUP; return -1; }
54 static inline int matchpathcon_init_prefix (char const *path,
55                                             char const *prefix)
56   { errno = ENOTSUP; return -1; }
57 #endif