Mail Archives: djgpp-workers/2005/01/01/11:27:24
On Sat, 01 Jan 2005 12:45:51 +0200, Eli Zaretskii <eliz AT gnu DOT org>
wrote:
>> Date: Fri, 31 Dec 2004 19:57:23 -0700
>> From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
>>
>> On Sat, 01 Jan 2005 02:19:31 +0100 (CET), ams AT ludd DOT ltu DOT se wrote:
>>
>> >According to Brian Inglis:
>> >> On Fri, 31 Dec 2004 13:42:52 +0100 (CET), ams AT ludd DOT ltu DOT se wrote:
>> >...
>> >> >Missing POSIX functions:
>> >> >asctime_r
>> >> >ctime_r
>> >> >gmtime_r
>> >> >localtime_r
>> >> >strptime
>> >>
>> >> I can supply those as part of my changes to time functions.
>> >
>> >Let's hear it! (Post the patches, i.e.)
>>
>> How do we want to handle these?
>> The ISO functions become wrappers which define static storage and call
>> the POSIX *_r functions.
>> Do we want to define the POSIX functions as _*_r and then use the
>> _/environ approach to define them when referenced, have the POSIX
>> headers #define *_r as _*_r, or have POSIX functions *_r call _*_r?
>
>Some design decision is in order, IMHO.
>
>The *_r functions are supposed to be reentrant versions of the
>respective non-*_r functions, right? So what reentrancy are we
>willing to have? Do we want functions that are thread-safe wrt some
>threading package ported to DJGPP? Or do we claim that, since DJGPP
>doesn't support multithreading as part of the basic package, the *_r
>functions can simply be aliases for non-*_r functions?
The *_r _POSIX_THREAD_SAFE_FUNCTIONS have different interfaces that
support reentrancy/threads by allowing the caller to pass a
buffer/struct pointer instead of using/returning an internal static
buffer/struct.
Allocation of any other buffer/struct storage required as auto/dynamic
should be sufficient to meet the reentrancy requirement.
I don't think we need to worry explicitly about threads within these
functions.
--
Thanks. Take care, Brian Inglis
- Raw text -