diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-11-16 18:56:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-11-17 11:12:33 +0100 |
commit | 57a4359ee0bf65c16336e8157f0f9d2b084ddac3 (patch) | |
tree | 1b5e309c796a4f549a5afdfd8ede5a100375c2d8 /src/basic/fs-util.h | |
parent | man: document how nspawn's --bind= and --private-users interact (diff) | |
download | systemd-57a4359ee0bf65c16336e8157f0f9d2b084ddac3.tar.xz systemd-57a4359ee0bf65c16336e8157f0f9d2b084ddac3.zip |
fs-util: add access_fd() which is like access() but for fds
Linux doesn't have faccess(), hence let's emulate it. Linux has access()
and faccessat() but neither allows checking the access rights of an fd
passed in directly.
Diffstat (limited to 'src/basic/fs-util.h')
-rw-r--r-- | src/basic/fs-util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index d3342d5cda..9849522f5a 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -98,3 +98,5 @@ static inline void unlink_and_free(char *p) { free(p); } DEFINE_TRIVIAL_CLEANUP_FUNC(char*, unlink_and_free); + +int access_fd(int fd, int mode); |