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_readatb.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/libunixonacid/openc_readatb.c (limited to 'src/libunixonacid/openc_readatb.c') diff --git a/src/libunixonacid/openc_readatb.c b/src/libunixonacid/openc_readatb.c new file mode 100644 index 0000000..4da65ab --- /dev/null +++ b/src/libunixonacid/openc_readatb.c @@ -0,0 +1,12 @@ +/* ISC license. */ + +#include +#include + +int openc_readatb (int dirfd, char const *name) +{ + int fd = openc_readat(dirfd, name) ; + if (fd < 0) return -1 ; + if (ndelay_off(fd) < 0) return -1 ; + return fd ; +} -- cgit v1.2.3