This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: supplying _foo_r functions when -DREENTRANT_SYSCALLS_PROVIDED

On Wed, Mar 26, 2008 at 04:47:31PM -0400, Jeff Johnston wrote:
> Patrick Mansfield wrote:

>> Here's RFC patch, it shows the reent.h with changes per above.
>> Where should these defines go? 
>> Is this the right way to make this change?
> This is too SPU-specific.  It just so happens that spu replaces a number of 
> newlib functions (e.g. I/O functions) that would use other syscalls you 
> haven't included.
> The correct way to do this is to check for both MISSING_SYSCALL_NAMES and 
> REENTRANT_SYSCALLS_INCLUDED and then to create macros for all the newlib 
> reentrant syscalls found in libc/reent.  

OK, I have a patch for that part, no problem.

> This would need to be documented 
> in libc/include/reent.h as a new alternative.  

reent.h implies defining both is already OK, it has the "three ways", but
then it says:

   Stubs of the reentrant versions of the syscalls exist in the libc/reent
   source directory and are used if REENTRANT_SYSCALLS_PROVIDED isn't defined.
   They use the native system calls: _open, _close, etc. if they're available
   (MISSING_SYSCALL_NAMES is *not* defined), otherwise open, close, etc.
   (MISSING_SYSCALL_NAMES *is* defined).  */

Do you want me to clean that up? I guess change to "two ways" and then add
a bit to the above about the MISSING_SYSCALL_NAMES behaviour.

> Some mention should probably 
> be made to note that if multiple threads are possible, then dynamic 
> reentrancy needs to be used (__DYNAMIC_REENT__).

By "multiple threads" does that mean SMP with threads?

Even then, I don't fully understand when __DYNAMIC_REENT__ should be used.

>  BTW: the macro variable 
> names should be double-underscored.

OK, I'll do that, but I thought the macro args were processed such that
it's not required.

> Putting them in reent.h seems a reasonable place since all code includes 
> this file.


-- Patrick Mansfield

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]