From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1035) id C14C93858025; Wed, 26 May 2021 14:21:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C14C93858025 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Richard Earnshaw To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] aarch64: support binary mode for opening files X-Act-Checkin: newlib-cygwin X-Git-Author: Richard Earnshaw X-Git-Refname: refs/heads/master X-Git-Oldrev: fd84f6cf5107076cf881f0e0c62cc10b1e160e36 X-Git-Newrev: 2a3a03972b35377aef8d3d52d873ac3b8fcc512c Message-Id: <20210526142108.C14C93858025@sourceware.org> Date: Wed, 26 May 2021 14:21:08 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2021 14:21:08 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2a3a03972b35377aef8d3d52d873ac3b8fcc512c commit 2a3a03972b35377aef8d3d52d873ac3b8fcc512c Author: Richard Earnshaw Date: Wed May 26 15:17:11 2021 +0100 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. Diff: --- newlib/libc/machine/aarch64/sys/fcntl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 + +/* 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_ */