From: Godmar Back (gback@cs.utah.edu)
Date: Sat Feb 06 1999 - 22:48:28 EST
>
> On Feb 5, 1999, Godmar Back <gback@cs.utah.edu> wrote:
>
> > Unfortunately, libltdl uses stdio, although it didn't look like that
> > would be hard to fix.
>
> Where does it?
in ltdl.c, search for fopen, feof, and fclose.
>
> > I must admit I don't know about sprintf: is it async-signal-safe?
>
> I doubt we can assume it is. Even if it is in one platform or two,
> we'd better assume it is not, since some implementor might decide to
> save state in static variables.
>
I looked at the posix standard, and they don't even list the functions
that are asynch-signal-unsafe. They list the ones that are safe and
say everything else is unsafe. Their list pretty much only includes
what's traditionally been implemented as system calls.
So, sprintf is not safe.
I think we should just steal a stand-alone snprintf implementation from
somewhere: for instance, from the OSKit (or even from Linux's ld.so).
Floating point is somewhat of a problem, but I think we use that only
for java.lang.Double (where we can easily protect the real sprintf)
- Godmar
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:59 EDT