summaryrefslogtreecommitdiffstats
path: root/src/basic/fs-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-16 18:56:25 +0100
committerLennart Poettering <lennart@poettering.net>2017-11-17 11:12:33 +0100
commit57a4359ee0bf65c16336e8157f0f9d2b084ddac3 (patch)
tree1b5e309c796a4f549a5afdfd8ede5a100375c2d8 /src/basic/fs-util.h
parentman: document how nspawn's --bind= and --private-users interact (diff)
downloadsystemd-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.h2
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);