fcntl: change the O_RSYNC definition from 0 to O_SYNC

fix the /tset/rt.os/files/open/T.open{2}:
O_RSYNC flag not set

According to the POSIX standard, when we set the oflags
for a file descriptor via open, retrieving these oflags
later via fcntl should yield the same values as those
passed during the open call.

Given this, if the value of O_RSYNC were zero, then even
if O_RSYNC were passed during the open call, it would not
be detectable in the oflags retrieved by fcntl.
Therefore, we need to define O_RSYNC as a non-zero value.

For this reason, we have chosen to set the value of
O_RSYNC to be the same as O_SYNC.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao
2026-01-15 02:22:46 +08:00
committed by Xiang Xiao
parent 4dec7c2766
commit 98eef560a3
+1 -1
View File
@@ -67,7 +67,7 @@
/* Unsupported, but required open flags */
#define O_RSYNC 0 /* Synchronize input on read */
#define O_RSYNC O_SYNC /* Synchronize input on read */
#define O_ACCMODE O_RDWR /* Mask for access mode */
#define O_NOCTTY 0 /* Required by POSIX */
#define O_BINARY 0 /* Open the file in binary (untranslated) mode. */