From 37b42c179bb00d05cb47c739cb95283548f84fb2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 30 May 2022 19:51:44 +0000 Subject: Add openc_*at functions Signed-off-by: Laurent Bercot --- src/libunixonacid/openc_truncat.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/libunixonacid/openc_truncat.c (limited to 'src/libunixonacid/openc_truncat.c') diff --git a/src/libunixonacid/openc_truncat.c b/src/libunixonacid/openc_truncat.c new file mode 100644 index 0000000..8ce50d2 --- /dev/null +++ b/src/libunixonacid/openc_truncat.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include + +#include + +int openc_truncat (int fd, char const *name) +{ + return open3_at(fd, name, O_WRONLY | O_NONBLOCK | O_TRUNC | O_CREAT | O_CLOEXEC, 0666) ; +} -- cgit v1.2.3