1 /* Replacement <selinux/selinux.h> for platforms that lack it.
2 Copyright (C) 2008-2011 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef _GL_SELINUX_SELINUX_H
18 # define _GL_SELINUX_SELINUX_H
21 @PRAGMA_SYSTEM_HEADER@
25 # if HAVE_SELINUX_SELINUX_H
27 #@INCLUDE_NEXT@ @NEXT_SELINUX_SELINUX_H@
31 # include <sys/types.h>
34 /* The definition of _GL_UNUSED_PARAMETER is copied here. */
36 typedef unsigned short security_class_t;
37 # define security_context_t char*
38 # define is_selinux_enabled() 0
40 static inline int getcon (security_context_t *con _GL_UNUSED_PARAMETER)
41 { errno = ENOTSUP; return -1; }
42 static inline void freecon (security_context_t con _GL_UNUSED_PARAMETER) {}
45 static inline int getfscreatecon (security_context_t *con _GL_UNUSED_PARAMETER)
46 { errno = ENOTSUP; return -1; }
47 static inline int setfscreatecon (security_context_t con _GL_UNUSED_PARAMETER)
48 { errno = ENOTSUP; return -1; }
49 static inline int matchpathcon (char const *file _GL_UNUSED_PARAMETER,
50 mode_t m _GL_UNUSED_PARAMETER,
51 security_context_t *con _GL_UNUSED_PARAMETER)
52 { errno = ENOTSUP; return -1; }
53 static inline int getfilecon (char const *file _GL_UNUSED_PARAMETER,
54 security_context_t *con _GL_UNUSED_PARAMETER)
55 { errno = ENOTSUP; return -1; }
56 static inline int lgetfilecon (char const *file _GL_UNUSED_PARAMETER,
57 security_context_t *con _GL_UNUSED_PARAMETER)
58 { errno = ENOTSUP; return -1; }
59 static inline int fgetfilecon (int fd,
60 security_context_t *con _GL_UNUSED_PARAMETER)
61 { errno = ENOTSUP; return -1; }
62 static inline int setfilecon (char const *file _GL_UNUSED_PARAMETER,
63 security_context_t con _GL_UNUSED_PARAMETER)
64 { errno = ENOTSUP; return -1; }
65 static inline int lsetfilecon (char const *file _GL_UNUSED_PARAMETER,
66 security_context_t con _GL_UNUSED_PARAMETER)
67 { errno = ENOTSUP; return -1; }
68 static inline int fsetfilecon (int fd _GL_UNUSED_PARAMETER,
69 security_context_t con _GL_UNUSED_PARAMETER)
70 { errno = ENOTSUP; return -1; }
72 static inline int security_check_context
73 (security_context_t con _GL_UNUSED_PARAMETER)
74 { errno = ENOTSUP; return -1; }
75 static inline int security_check_context_raw
76 (security_context_t con _GL_UNUSED_PARAMETER)
77 { errno = ENOTSUP; return -1; }
78 static inline int setexeccon (security_context_t con _GL_UNUSED_PARAMETER)
79 { errno = ENOTSUP; return -1; }
80 static inline int security_compute_create
81 (security_context_t scon _GL_UNUSED_PARAMETER,
82 security_context_t tcon _GL_UNUSED_PARAMETER,
83 security_class_t tclass _GL_UNUSED_PARAMETER,
84 security_context_t *newcon _GL_UNUSED_PARAMETER)
85 { errno = ENOTSUP; return -1; }
86 static inline int matchpathcon_init_prefix
87 (char const *path _GL_UNUSED_PARAMETER,
88 char const *prefix _GL_UNUSED_PARAMETER)
89 { errno = ENOTSUP; return -1; }
92 #endif /* _GL_SELINUX_SELINUX_H */