Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2021-05-26 17:17:11 +0300
committerRichard Earnshaw <rearnsha@arm.com>2021-05-26 17:17:11 +0300
commit2a3a03972b35377aef8d3d52d873ac3b8fcc512c (patch)
treecd2c064fd01683d413cddec30b385cb0b0fc29a0 /newlib/libc
parentfd84f6cf5107076cf881f0e0c62cc10b1e160e36 (diff)
aarch64: support binary mode for opening files
Newlib for aarch64 uses libgloss for the backend. One common libgloss implementation is the 'rdimon' implementation, which uses the Arm Semihosting protocol. In order to support a remote host that runs on Windows we need to know whether a file is to be opened in binary or text mode. That means that we need to preserve this information via O_BINARY until we know what the libgloss binding will be. This patch simply copies the arm implementation from sys/arm/sys and puts it in machine/aarch64/sys, because we don't have a 'sys' subtree on aarch64.
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/machine/aarch64/sys/fcntl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/newlib/libc/machine/aarch64/sys/fcntl.h b/newlib/libc/machine/aarch64/sys/fcntl.h
new file mode 100644
index 000000000..7da1d46da
--- /dev/null
+++ b/newlib/libc/machine/aarch64/sys/fcntl.h
@@ -0,0 +1,12 @@
+#ifndef _SYS_FCNTL_H_
+#define _SYS_FCNTL_H_
+
+#include <sys/_default_fcntl.h>
+
+/* We want to support O_BINARY for the open syscall.
+ For example, the Demon debug monitor has a separate
+ flag value for "rb" vs "r". */
+#define _FBINARY 0x10000
+#define O_BINARY _FBINARY
+
+#endif /* _SYS_FCNTL_H_ */