Subject: Re: syslog_r (Re: CVS commit: src/lib/libc)
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 10/28/2006 02:01:45
> syslog_ss (or _a) cannot support the following things:
> - floating point formats
> - %m
> - sending the time of the event to syslogd(8)

I don't see why not.  In each case, you either lose some aspect of the
functionality or you have to push signal-safe-ness down into the called
functionality, but certainly a functionality subset large enough to be
useful could easily be done.

For floating point, you could do a stripped-down dtoa-alike that might
not handle NaNs and infinities, or some such, but still basically works
for "ordinary" numbers.

For %m, you could use sys_errlist[] / sys_nerr instead of strerror(),
and unroll the snprintf (which is used in an exceptionally simple way).

For the time, you could give up on timezones other than UTC.

This is not to say that I believe any of the above are worth doing.
Just pointing out that "cannot" is putting it a bit too strongly.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B