readlink: remove superfluous comma from usage output
[coreutils.git] / gl / lib / smack.h
blob1d31472252757626f0dccbc7a57f777fd7ed8afc
1 /* Include and determine availability of smack routines
2 Copyright (C) 2013-2017 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 #include <config.h>
22 #ifdef HAVE_SMACK
23 # include <sys/smack.h>
24 #else
25 static inline ssize_t
26 smack_new_label_from_self (char **label)
28 return -1;
31 static inline int
32 smack_set_label_for_self (const char *label)
34 return -1;
36 #endif
38 static inline bool
39 is_smack_enabled (void)
41 #ifdef HAVE_SMACK
42 return smack_smackfs_path () != NULL;
43 #else
44 return false;
45 #endif