Re: tmpnam vs mkstemp, was Re: [Exim] Problem with compiling…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: Tamas TEVESZ
CC: exim-users
題目: Re: tmpnam vs mkstemp, was Re: [Exim] Problem with compiling exim-3.22 on Linux
On Thu, 29 Mar 2001, Tamas TEVESZ wrote:

> > appendfile.o(.text+0x2cba): the use of `tmpnam' is dangerous,
> > better use `mkstemp'
>
> actually this is true. is it possible to change tmpnams to mkstemp
> (where available?)


I try to use Standard C where possible. The function tmpnam() is in the
standard, whereas mkstemp() is not. Can you guarantee that mkstemp() is
available in every version of Unix that Exim supports? The RedHat Linux
man page states

CONFORMING TO
       BSD 4.3


which suggests it won't be in every Unix. Also, I see that the Solaris 8
man page states:

     The tmpfile(3C) function is preferred over this function.


This does not inspire me with confidence. However, tmpfile() *is* in the
Standard. I'm not sure why I didn't make use of it (probably just forgot
about its existence). I've noted the issue for investigation.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.