doc: pwd: improve the -P help description
[coreutils.git] / gl / lib / smack.h
blobb3489360b77a8b1b54778b66d899c9ef644c4a6c
1 /* Include and determine availability of smack routines
2 Copyright (C) 2013-2024 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 <https://www.gnu.org/licenses/>. */
17 /* Here we replace or wrap the most common smack functions used by coreutils.
18 Others will need to be protected by HAVE_SMACK. */
20 #ifdef HAVE_SMACK
21 # include <sys/smack.h>
22 #else
23 static inline ssize_t
24 smack_new_label_from_self (char **label)
26 return -1;
29 static inline int
30 smack_set_label_for_self (char const *label)
32 return -1;
34 #endif
36 static inline bool
37 is_smack_enabled (void)
39 #ifdef HAVE_SMACK
40 return smack_smackfs_path () != nullptr;
41 #else
42 return false;
43 #endif