VirtualBox

source: kBuild/trunk/src/sed/lib/se-context.in.h@ 3657

Last change on this file since 3657 was 3613, checked in by bird, 7 months ago

src/sed: Merged in changes between 4.1.5 and 4.9 from the vendor branch. (svn merge /vendor/sed/4.1.5 /vendor/sed/current .)

File size: 3.0 KB
Line 
1/* SELinux-related headers.
2 Copyright (C) 2007-2022 Free Software Foundation, Inc.
3
4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) any later version.
8
9 This file 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 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16
17/* Written by Jim Meyering, 2007. */
18
19#ifndef SELINUX_CONTEXT_H
20# define SELINUX_CONTEXT_H
21
22# include <errno.h>
23
24#ifndef _GL_INLINE_HEADER_BEGIN
25 #error "Please include config.h first."
26#endif
27_GL_INLINE_HEADER_BEGIN
28#ifndef SE_CONTEXT_INLINE
29# define SE_CONTEXT_INLINE _GL_INLINE
30#endif
31
32/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
33 the entity is not used. The compiler should not warn if the entity is not
34 used. */
35#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
36# if 0 /* no GCC or clang version supports this yet */
37# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
38# elif defined __GNUC__ || defined __clang__
39# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
40# else
41# define _GL_ATTRIBUTE_MAYBE_UNUSED
42# endif
43#endif
44
45typedef int context_t;
46SE_CONTEXT_INLINE context_t
47context_new (_GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
48 { errno = ENOTSUP; return 0; }
49SE_CONTEXT_INLINE char *
50context_str (_GL_ATTRIBUTE_MAYBE_UNUSED context_t con)
51 { errno = ENOTSUP; return (void *) 0; }
52SE_CONTEXT_INLINE void context_free (_GL_ATTRIBUTE_MAYBE_UNUSED context_t c) {}
53
54SE_CONTEXT_INLINE int
55context_user_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
56 _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
57 { errno = ENOTSUP; return -1; }
58SE_CONTEXT_INLINE int
59context_role_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
60 _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
61 { errno = ENOTSUP; return -1; }
62SE_CONTEXT_INLINE int
63context_range_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
64 _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
65 { errno = ENOTSUP; return -1; }
66SE_CONTEXT_INLINE int
67context_type_set (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc,
68 _GL_ATTRIBUTE_MAYBE_UNUSED char const *s)
69 { errno = ENOTSUP; return -1; }
70SE_CONTEXT_INLINE char *
71context_type_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
72 { errno = ENOTSUP; return (void *) 0; }
73SE_CONTEXT_INLINE char *
74context_range_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
75 { errno = ENOTSUP; return (void *) 0; }
76SE_CONTEXT_INLINE char *
77context_role_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
78 { errno = ENOTSUP; return (void *) 0; }
79SE_CONTEXT_INLINE char *
80context_user_get (_GL_ATTRIBUTE_MAYBE_UNUSED context_t sc)
81 { errno = ENOTSUP; return (void *) 0; }
82
83_GL_INLINE_HEADER_END
84
85#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette