nmh-workers
[Top] [All Lists]

Re: Portability patch for nmh 0.24's snprintf.c (for ULTRIX and...?)

1998-04-10 10:04:04

Richard Coleman <coleman(_at_)math(_dot_)gatech(_dot_)edu> writes:
It's ironic, because this snprintf.c is only used on OSes with no native
snprintf(), but they use a function which is likely not to be there on some
of those same OSes.  tmpfile(), on the other hand, is portable -- it comes
from <stdio.h>, so this patch should be incorporated into nmh 0.25 (whoever
ends up doing that), I think.

The reason that mkstemp is used rather than tmpfile, is that many
systems have a bad race condition in tmpfile.  At least that's what
I was told (I got the code from the bugtrac's mailing list).

Ah.  Darn.  Well, maybe the configure process could check to see if
mkstemp() exists and use tmpfile() if it doesn't?

What's the race condition?

--
Dan Harkless
dharkless(_at_)unitech(_dot_)com
Unitech Research, Inc.


<Prev in Thread] Current Thread [Next in Thread>