This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
syscalls, libgloss, errno
- From: Vincent Rivière <vincent dot riviere at freesbee dot fr>
- To: newlib at sourceware dot org
- Date: Tue, 01 Jan 2008 21:19:31 +0100
- Subject: syscalls, libgloss, errno
Happy New Year 2008 !
I have spent some time studying the Newlib sources, especially the way
how reentrant syscalls are implemented.
I still can't understand some things.
From a user program linked against newlib and libgloss, is it possible
to call the syscalls (open, close, etc.) and to get the errors in the
standard way, by including <errno.h> and using errno ?
Is it possible with the current implementation of libnosys ?
I imagine that it would be possible to define
REENTRANT_SYSCALLS_PROVIDED, implement the _syscalls_r in libgloss,
implement the _syscalls too (by calling the _r versions). Then the
syscalls (without _) will be automatically implemented by libc/syscalls/*
Thus the global variable errno will never be used, and everything will
be OK.
In other words: is there a simple way to implement the syscalls (in
whatever form) in order to be able to call open() and fopen() and to get
the error values from errno, by simply including <errno.h> ?
And another question: when porting Newlib to a new target (in 2008 !),
is it best to put everything (syscalls needed by Newlib, and all the
others) into libgloss, or in libc/sys ?
Regards,
--
Vincent Rivière