1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-08-08 15:25:39 +02:00 committed by Volker Lendecke
parent 37ba6df174
commit b89001e922

View File

@ -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 */