diff options
author | Stefan Metzmacher <metze@samba.org> | 2022-08-08 15:25:39 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2022-08-16 18:27:13 +0000 |
commit | dd18624395dc8a7cd2cfc9527961ae2f1375b744 (patch) | |
tree | 5b2502198882c9c0c3cf1281b2e61f3e24c6c78c /lib | |
parent | b9a1441238f17c3873938bc78de215cd607c36f7 (diff) | |
download | samba-dd18624395dc8a7cd2cfc9527961ae2f1375b744.tar.gz |
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>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15146
(cherry picked from commit b89001e9226ecb0f4e5c906f7195f0e53cd7d608)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/replace/replace.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 */ |