]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/chattr-util.h
meson: make user $PATH configurable
[thirdparty/systemd.git] / src / basic / chattr-util.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
c8b3094d
LP
2#pragma once
3
8a016c74
LP
4#include <linux/fs.h>
5
6#include "missing_fs.h"
7
8/* The chattr() flags to apply when creating a new file *before* writing to it. In particular, flags such as
9 * FS_NOCOW_FL don't work if applied a-posteriori. All other flags are fine (or even necessary, think
10 * FS_IMMUTABLE_FL!) to apply after writing to the files. */
11#define CHATTR_EARLY_FL \
12 (FS_NOATIME_FL | \
13 FS_COMPR_FL | \
14 FS_NOCOW_FL | \
15 FS_NOCOMP_FL | \
16 FS_PROJINHERIT_FL)
17
d629ba70
LP
18#define CHATTR_ALL_FL \
19 (FS_NOATIME_FL | \
20 FS_SYNC_FL | \
21 FS_DIRSYNC_FL | \
22 FS_APPEND_FL | \
23 FS_COMPR_FL | \
24 FS_NODUMP_FL | \
25 FS_EXTENT_FL | \
26 FS_IMMUTABLE_FL | \
27 FS_JOURNAL_DATA_FL | \
28 FS_SECRM_FL | \
29 FS_UNRM_FL | \
30 FS_NOTAIL_FL | \
31 FS_TOPDIR_FL | \
32 FS_NOCOW_FL | \
33 FS_PROJINHERIT_FL)
34
db9a4254
LP
35int chattr_fd(int fd, unsigned value, unsigned mask, unsigned *previous);
36int chattr_path(const char *p, unsigned value, unsigned mask, unsigned *previous);
c8b3094d
LP
37
38int read_attr_fd(int fd, unsigned *ret);
39int read_attr_path(const char *p, unsigned *ret);