All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: openrisc@lists.librecores.org
Subject: [OpenRISC] [PATCH 1/3] or1k: Make open reentrant
Date: Mon,  6 Feb 2017 23:38:38 +0900	[thread overview]
Message-ID: <608a0c980e753934e9bb15fb02e2e9302bad1b4f.1486391219.git.shorne@gmail.com> (raw)
In-Reply-To: <cover.1486391219.git.shorne@gmail.com>

From: Olof Kindgren <olof.kindgren@gmail.com>

or1k uses reentrant calls by default, but there was no open_r defined
which caused failure in C++/C code such as:

int main() { std::cout << "test\n";  return 0; }

or

int main() {open(".", 0);}
---
 libgloss/or1k/syscalls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgloss/or1k/syscalls.c b/libgloss/or1k/syscalls.c
index 690d21a..3e2ad22 100644
--- a/libgloss/or1k/syscalls.c
+++ b/libgloss/or1k/syscalls.c
@@ -124,7 +124,7 @@ _lseek_r(struct _reent *reent, int file, _off_t ptr, int dir)
 }
 
 int
-_open(struct _reent *reent, char *file, int flags, int mode)
+_open_r(struct _reent *reent, const char *file, int flags, int mode)
 {
 	reent->_errno = ENOSYS;
 	return -1;
-- 
2.9.3


  reply	other threads:[~2017-02-06 14:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 14:38 [OpenRISC] [PATCH 0/3] openrisc: various fixes Stafford Horne
2017-02-06 14:38 ` Stafford Horne [this message]
2017-02-06 14:38 ` [OpenRISC] [PATCH 2/3] libgloss: or1k: If available call the init for init_array Stafford Horne
2017-02-06 14:38 ` [OpenRISC] [PATCH 3/3] libgloss: Remove duplicate definition of environ Stafford Horne
2017-03-15 11:44 ` [OpenRISC] [PATCH 0/3] openrisc: various fixes Stafford Horne
2017-03-15 21:59   ` Stafford Horne
2017-03-15 22:10   ` Stafford Horne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=608a0c980e753934e9bb15fb02e2e9302bad1b4f.1486391219.git.shorne@gmail.com \
    --to=shorne@gmail.com \
    --cc=openrisc@lists.librecores.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.