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:
parent
37ba6df174
commit
b89001e922
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user