[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [MiNT] Incorporating other calls into the



> From: owner-mint@fishpool.com [mailto:owner-mint@fishpool.com]On Behalf
> Of Guido Flohr
> Sent: Tuesday, June 29, 1999 4:30 PM
> To: MiNT mailing list
> Subject: Re: [MiNT] Incorporating other calls into the
>
>
> Hi,
>
> On Tue, Jun 29, 1999 at 01:26:54PM +0200, Julian Reschke wrote:
> > Well,
> >
> > those parts of the library which are supposed to work within a
> MagiC style
> > SLB may not use *any* static variables (unless they are really
> static, like
> > a variable to store the _MCH cookie or the MiNT version information).
>
> What about for example localtime and gmtime?  As far as I remember they
> _must_ return a pointer to the same static buffer.  Or strtok? Or
> getpwent?

Well, if they need static storage, they either need to allocate it on their
own on a thread basis, or they can't be used in a multi threaded program or
in a MagiC style library-

> If you have a look at current MiNTLibs you will see that I more and more
> follow the strategy of the GNU libc in such cases: Take for example the
> getpw* function family.  All of these functions (no matter if they are
> reentrant or not) end up with a call to `__fgetpwent_r', an internal
> library function (for which `fgetpwent_r' is a weak alias in case you
> need it yourself).  If the function definition requires that the space for
> the result is statically allocated the buffer is provided within the
> library.  If it is needed by other functions (for example in the case of
> asctime/ctime or gmtime/localtime) then it is globally declared and
> `hidden' behind double underscores which are reserved to the library.  But
> if only that very function needs the buffer I usually define it
> statically within the library module.  Would this break the SLB loader?

I think so.

> I must admit that I'm currently not certain which symbols will end up in
> the text and which will end up in the data segment.
>
> Anyway, if the SLB loader requires major changes in the MiNTLib, please
> don't expect me to do this on my own and within a week.  (This remark is
> not addressed to Julian but to all that want to use the SLB loader).

Nobody expects this.

But we can certainly *start* with something, like regexp, stdio, and so on.
Don't try to solve everything at once :-)