summaryrefslogtreecommitdiff
path: root/lib/include/util.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-04 14:44:11 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-04 14:45:46 +0100
commit074fe20a4761e284af2aa46f978f48410cfa60c5 (patch)
tree22072c796e6da53263ce5df50fbb11d805f5e3ee /lib/include/util.h
parent34f542b7cc6e84403326acf145487a7d83175a11 (diff)
Add fopenat utility function
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib/include/util.h')
-rw-r--r--lib/include/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/include/util.h b/lib/include/util.h
index 925a1f0..f300329 100644
--- a/lib/include/util.h
+++ b/lib/include/util.h
@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <stdbool.h>
#include <stddef.h>
+#include <stdio.h>
#include "config.h"
@@ -83,5 +84,11 @@ int setup_tty(const char *tty, bool truncate);
NORETURN void argv_exec(exec_t *e);
+/*
+ Similar to openat: opens a file relative to a dirfd, but returns
+ a FILE pointer instead of an fd.
+ */
+FILE *fopenat(int fd, const char *filename, const char *mode);
+
#endif /* UTIL_H */