mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-15 03:41:57 +02:00
* src/basenc.c (no_required_padding): * gl/lib/smack.h (smack_new_label_from_self) (smack_set_label_for_self): * src/cksum.c (output_crc): * src/digest.c (md5_sum_stream, sha1_sum_stream) (sha224_sum_stream, sha256_sum_stream, sha384_sum_stream) (sha512_sum_stream, sm3_sum_stream, output_file): * src/stat.c (print_statfs, print_stat): * src/sum.c (output_bsd, output_sysv): * src/timeout.c (chld): Mark possibly-unused parameters with MAYBE_UNUSED.
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
/* Include and determine availability of smack routines
|
|
Copyright (C) 2013-2025 Free Software Foundation, Inc.
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
|
|
|
/* Here we replace or wrap the most common smack functions used by coreutils.
|
|
Others will need to be protected by HAVE_SMACK. */
|
|
|
|
#ifdef HAVE_SMACK
|
|
# include <sys/smack.h>
|
|
#else
|
|
static inline ssize_t
|
|
smack_new_label_from_self (MAYBE_UNUSED char **label)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline int
|
|
smack_set_label_for_self (MAYBE_UNUSED char const *label)
|
|
{
|
|
return -1;
|
|
}
|
|
#endif
|
|
|
|
static inline bool
|
|
is_smack_enabled (void)
|
|
{
|
|
#ifdef HAVE_SMACK
|
|
return smack_smackfs_path () != nullptr;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|