This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 1/3] or1k: Make open reentrant
- From: Stafford Horne <shorne at gmail dot com>
- To: newlib at sourceware dot org
- Cc: openrisc at lists dot librecores dot org, stefan dot wallentowitz at posteo dot de, Olof Kindgren <olof dot kindgren at gmail dot com>
- Date: Mon, 6 Feb 2017 23:38:38 +0900
- Subject: [PATCH 1/3] or1k: Make open reentrant
- Authentication-results: sourceware.org; auth=none
- References: <cover.1486391219.git.shorne@gmail.com>
- References: <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