diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-03-14 17:10:48 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-03-21 15:20:01 +0100 |
commit | 14460a8a2b8ad51ddbee772db057e1107d0bec3d (patch) | |
tree | 95e9297eb7ee137c8024e1adb6f5a4bc77a36917 /src/basic/fs-util.h | |
parent | aea3ca36135aeb74ea38e7538c710d92b37f479d (diff) | |
download | systemd-14460a8a2b8ad51ddbee772db057e1107d0bec3d.tar.gz |
fs-util: Add open_parent_at()
Diffstat (limited to 'src/basic/fs-util.h')
-rw-r--r-- | src/basic/fs-util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index b66dda01b4..d08e224aa1 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -113,7 +113,10 @@ typedef enum UnlinkDeallocateFlags { int unlinkat_deallocate(int fd, const char *name, UnlinkDeallocateFlags flags); -int open_parent(const char *path, int flags, mode_t mode); +int open_parent_at(int dir_fd, const char *path, int flags, mode_t mode); +static inline int open_parent(const char *path, int flags, mode_t mode) { + return open_parent_at(AT_FDCWD, path, flags, mode); +} int conservative_renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); static inline int conservative_rename(const char *oldpath, const char *newpath) { |