1 /* Replacement <selinux/selinux.h> for platforms that lack it.
2 Copyright (C) 2008-2010 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@
24 # if HAVE_SELINUX_SELINUX_H
26 #@INCLUDE_NEXT@ @NEXT_SELINUX_SELINUX_H@
30 # include <sys/types.h>
33 /* The definition of _GL_UNUSED_PARAMETER is copied here. */
35 typedef unsigned short security_class_t;
36 # define security_context_t char*
37 # define is_selinux_enabled() 0
39 static inline int getcon (security_context_t *con _GL_UNUSED_PARAMETER)
40 { errno = ENOTSUP; return -1; }
41 static inline void freecon (security_context_t con _GL_UNUSED_PARAMETER) {}
44 static inline int getfscreatecon (security_context_t *con _GL_UNUSED_PARAMETER)
45 { errno = ENOTSUP; return -1; }
46 static inline int setfscreatecon (security_context_t con _GL_UNUSED_PARAMETER)
47 { errno = ENOTSUP; return -1; }
48 static inline int matchpathcon (char const *file _GL_UNUSED_PARAMETER,
49 mode_t m _GL_UNUSED_PARAMETER,
50 security_context_t *con _GL_UNUSED_PARAMETER)
51 { errno = ENOTSUP; return -1; }
52 static inline int getfilecon (char const *file _GL_UNUSED_PARAMETER,
53 security_context_t *con _GL_UNUSED_PARAMETER)
54 { errno = ENOTSUP; return -1; }
55 static inline int lgetfilecon (char const *file _GL_UNUSED_PARAMETER,
56 security_context_t *con _GL_UNUSED_PARAMETER)
57 { errno = ENOTSUP; return -1; }
58 static inline int fgetfilecon (int fd,
59 security_context_t *con _GL_UNUSED_PARAMETER)
60 { errno = ENOTSUP; return -1; }
61 static inline int setfilecon (char const *file _GL_UNUSED_PARAMETER,
62 security_context_t con _GL_UNUSED_PARAMETER)
63 { errno = ENOTSUP; return -1; }
64 static inline int lsetfilecon (char const *file _GL_UNUSED_PARAMETER,
65 security_context_t con _GL_UNUSED_PARAMETER)
66 { errno = ENOTSUP; return -1; }
67 static inline int fsetfilecon (int fd _GL_UNUSED_PARAMETER,
68 security_context_t con _GL_UNUSED_PARAMETER)
69 { errno = ENOTSUP; return -1; }
71 static inline int security_check_context
72 (security_context_t con _GL_UNUSED_PARAMETER)
73 { errno = ENOTSUP; return -1; }
74 static inline int security_check_context_raw
75 (security_context_t con _GL_UNUSED_PARAMETER)
76 { errno = ENOTSUP; return -1; }
77 static inline int setexeccon (security_context_t con _GL_UNUSED_PARAMETER)
78 { errno = ENOTSUP; return -1; }
79 static inline int security_compute_create
80 (security_context_t scon _GL_UNUSED_PARAMETER,
81 security_context_t tcon _GL_UNUSED_PARAMETER,
82 security_class_t tclass _GL_UNUSED_PARAMETER,
83 security_context_t *newcon _GL_UNUSED_PARAMETER)
84 { errno = ENOTSUP; return -1; }
85 static inline int matchpathcon_init_prefix
86 (char const *path _GL_UNUSED_PARAMETER,
87 char const *prefix _GL_UNUSED_PARAMETER)
88 { errno = ENOTSUP; return -1; }
91 #endif /* _GL_SELINUX_SELINUX_H */