summaryrefslogtreecommitdiffstats
path: root/include/fileutils.h
diff options
context:
space:
mode:
authorGuillem Jover2015-06-06 06:19:05 +0200
committerKarel Zak2015-06-08 12:10:02 +0200
commit8e86d93d1e3f0c11b3fdca3246c4f3a267acf8eb (patch)
tree50db242d8bde7b5c63807a6bac6a3b36360d9be3 /include/fileutils.h
parentman: fix nolazytime typo in mount(8) (diff)
downloadkernel-qcow2-util-linux-8e86d93d1e3f0c11b3fdca3246c4f3a267acf8eb.tar.gz
kernel-qcow2-util-linux-8e86d93d1e3f0c11b3fdca3246c4f3a267acf8eb.tar.xz
kernel-qcow2-util-linux-8e86d93d1e3f0c11b3fdca3246c4f3a267acf8eb.zip
lib/fileutils: Add new dup_fd_cloexec function
This function duplicates and marks a file descriptor as close-on-exec. Takes care of build and run-time support for the fcntl F_DUPFD_CLOEXEC command, and other errors. Signed-off-by: Guillem Jover <guillem@hadrons.org>
Diffstat (limited to 'include/fileutils.h')
-rw-r--r--include/fileutils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/fileutils.h b/include/fileutils.h
index 3353f69a0..e0e2ecee1 100644
--- a/include/fileutils.h
+++ b/include/fileutils.h
@@ -25,6 +25,7 @@ static inline FILE *xfmkstemp(char **tmpname, char *dir)
return ret;
}
+extern int dup_fd_cloexec(int oldfd, int lowfd);
extern int get_fd_tabsize(void);
extern int mkdir_p(const char *path, mode_t mode);