From: Stefan Metzmacher Date: Mon, 8 Aug 2022 13:25:39 +0000 (+0200) Subject: lib/replace: use syscall(__NR_openat2) if available X-Git-Tag: talloc-2.4.0~1436 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b89001e9226ecb0f4e5c906f7195f0e53cd7d608;p=thirdparty%2Fsamba.git lib/replace: use syscall(__NR_openat2) if available There's no glibc wrapper for openat2() yet, so we need to use syscall(__NR_openat2) ourself. Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/lib/replace/replace.c b/lib/replace/replace.c index e937d81dbd1..5ec2f7ccc56 100644 --- a/lib/replace/replace.c +++ b/lib/replace/replace.c @@ -1087,7 +1087,15 @@ ssize_t rep_copy_file_range(int fd_in, long rep_openat2(int dirfd, const char *pathname, struct open_how *how, size_t size) { +#ifdef __NR_openat2 + return syscall(__NR_openat2, + dirfd, + pathname, + how, + size); +#else errno = ENOSYS; return -1; +#endif } #endif /* !HAVE_OPENAT2 */