1 // Copyright © Tavian Barnes <tavianator@tavianator.com>
2 // SPDX-License-Identifier: 0BSD
5 * A facade over (file)system features that are (un)implemented differently
14 #define BFS_CAN_CHECK_ACL BFS_USE_SYS_ACL_H
16 #if !defined(BFS_CAN_CHECK_CAPABILITIES) && BFS_USE_SYS_CAPABILITY_H
17 # include <sys/capability.h>
19 # define BFS_CAN_CHECK_CAPABILITIES true
23 #define BFS_CAN_CHECK_XATTRS (BFS_USE_SYS_EXTATTR_H || BFS_USE_SYS_XATTR_H)
28 * Check if a file has a non-trivial Access Control List.
33 * 1 if it does, 0 if it doesn't, or -1 if an error occurred.
35 int bfs_check_acl(const struct BFTW *ftwbuf);
38 * Check if a file has a non-trivial capability set.
43 * 1 if it does, 0 if it doesn't, or -1 if an error occurred.
45 int bfs_check_capabilities(const struct BFTW *ftwbuf);
48 * Check if a file has any extended attributes set.
53 * 1 if it does, 0 if it doesn't, or -1 if an error occurred.
55 int bfs_check_xattrs(const struct BFTW *ftwbuf);
58 * Check if a file has an extended attribute with the given name.
63 * The name of the xattr to check.
65 * 1 if it does, 0 if it doesn't, or -1 if an error occurred.
67 int bfs_check_xattr_named(const struct BFTW *ftwbuf, const char *name);