This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 98eef560a300842569037905b6407bb17431dc4f
Author: guoshichao <[email protected]>
AuthorDate: Mon Sep 15 19:55:39 2025 +0800

    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 <[email protected]>
---
 include/fcntl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/fcntl.h b/include/fcntl.h
index 5be8390ecec..e4ea81c629a 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -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. */

Reply via email to