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

lib/replace: let rep_openat2() inject O_LARGEFILE as needed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15251

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-11-23 11:38:20 +01:00
parent 4c2e1d6259
commit 6dddb268df

View File

@ -1116,6 +1116,22 @@ long rep_openat2(int dirfd, const char *pathname,
struct open_how *how, size_t size)
{
#ifdef __NR_openat2
#if _FILE_OFFSET_BITS == 64 && SIZE_MAX == 0xffffffffUL && defined(O_LARGEFILE)
struct open_how __how;
#if defined(O_PATH) && ! defined(DISABLE_OPATH)
if ((how->flags & O_PATH) == 0)
#endif
{
if (sizeof(__how) == size) {
__how = *how;
__how.flags |= O_LARGEFILE;
how = &__how;
}
}
#endif
return syscall(__NR_openat2,
dirfd,
pathname,