fix missing O_LARGEFILE values on x86_64, x32, and mips64

prior to commit 685e40bb09, x86_64 was
correctly passing O_LARGEFILE to SYS_open; it was removed (defined to
0 in the public header, and changed to use the public definition) as
part of that change, probably out of a mistaken belief that it's not
needed.

however, on a mixed system with 32-bit and 64-bit binaries, it's
important that all files be opened with O_LARGEFILE, even if the
opening process is 64-bit, in case a descriptor is passed to a 32-bit
process. otherwise, attempts to access past 2GB in the 32-bit process
could produce EOVERFLOW.

most 64-bit archs added later got this right alread, except for
mips64. x32 was also affected. there are now fixed.
This commit is contained in:
Rich Felker 2020-09-03 17:37:11 -04:00
parent 262003ad9d
commit b8b729bd22
3 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
#define O_ASYNC 010000
#define O_DIRECT 0100000
#define O_LARGEFILE 0
#define O_LARGEFILE 020000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000

View File

@ -13,7 +13,7 @@
#define O_ASYNC 020000
#define O_DIRECT 040000
#define O_LARGEFILE 0
#define O_LARGEFILE 0100000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000

View File

@ -13,7 +13,7 @@
#define O_ASYNC 020000
#define O_DIRECT 040000
#define O_LARGEFILE 0
#define O_LARGEFILE 0100000
#define O_NOATIME 01000000
#define O_PATH 010000000
#define O_TMPFILE 020200000