https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124616

--- Comment #16 from Steve Kargl <kargl at gcc dot gnu.org> ---
This diff fixes the issue for me.  Not sure if it is correct for non-FreeBSD
systems.


diff --git a/libgcobol/posix/shim/open.cc b/libgcobol/posix/shim/open.cc
index ed2a9d131b4..c15c55a6246 100644
--- a/libgcobol/posix/shim/open.cc
+++ b/libgcobol/posix/shim/open.cc
@@ -35,19 +35,20 @@ posix_open(const char *pathname, int cbl_flags, int
cbl_mode) {
     { cbl::PSX_O_APPEND, O_APPEND },
     { cbl::PSX_O_NONBLOCK, O_NONBLOCK },
     { cbl::PSX_O_DSYNC, O_DSYNC },
-    { cbl::PSX_O_LARGEFILE, O_LARGEFILE }, 
     { cbl::PSX_O_SYNC, O_SYNC }, 
     /*
      * The O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags are not specified in
      * POSIX.1-2001, but are specified in POSIX.1-2008.  See open(2). 
      */
 #if defined(_POSIX_C_SOURCE) && 200809L <= (_POSIX_C_SOURCE - 0)
+    { cbl::PSX_O_LARGEFILE, O_LARGEFILE }, 
     { cbl::PSX_O_CLOEXEC, O_CLOEXEC }, 
     { cbl::PSX_O_DIRECTORY, O_DIRECTORY }, 
     { cbl::PSX_O_NOFOLLOW, O_NOFOLLOW }, 
 #else
+    { cbl::PSX_O_LARGEFILE, 0 },
     { cbl::PSX_O_CLOEXEC, 0 }, 
-    { cbl::PSX_O_DIRECTORY, 0 }, 
+    { cbl::PSX_O_DIRECTORY, 0 },
     { cbl::PSX_O_NOFOLLOW, 0 },     
 #endif
     /*

Reply via email to