summaryrefslogtreecommitdiffstats
path: root/src/basic/fd-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-11-29 15:29:25 +0100
committerLennart Poettering <lennart@poettering.net>2022-11-29 15:32:47 +0100
commit5f5865f0ad8069ae01119e34c048a91eb5057143 (patch)
tree5a3a77e6251230a53371511b066e1427e8d92986 /src/basic/fd-util.h
parentMerge pull request #25385 from drvink/main (diff)
downloadsystemd-5f5865f0ad8069ae01119e34c048a91eb5057143.tar.xz
systemd-5f5865f0ad8069ae01119e34c048a91eb5057143.zip
fd-util: add new helper fd_reopen_conditional()
This is a wrapper around fd_reopen() that will reopen an fd if the F_GETFL flags indicate this is necessary, and otherwise not. This is useful for various utility calls that shall be able to operate on O_PATH and without it, and might need to convert between the two depending on what's passed in.
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r--src/basic/fd-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h
index 29c7d86f27..fbaa458613 100644
--- a/src/basic/fd-util.h
+++ b/src/basic/fd-util.h
@@ -108,6 +108,7 @@ static inline int make_null_stdio(void) {
})
int fd_reopen(int fd, int flags);
+int fd_reopen_condition(int fd, int flags, int mask, int *ret_new_fd);
int read_nr_open(void);
int fd_get_diskseq(int fd, uint64_t *ret);