[Top][All Lists]

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

Re: mkstemps

From: Jim Meyering
Subject: Re: mkstemps
Date: Mon, 29 Jun 2009 16:39:43 +0200

Eric Blake wrote:
> git recently started using mkstemps on systems that provide it (new enough
> Solaris has it in <stdlib.h>, some BSD have it in <unistd.h> even though
> it is not standardized, I've just proposed adding it to Cygwin via
> newlib).  The general idea of creating temporary files with a known suffix
> is nice.  Should we modify tempname.c's gen_tempname to also provide the
> ability to implement mkstemps?

I read this: http://docs.sun.com/app/docs/doc/819-2243/mkstemps-3c?a=view

      int mkstemps(char *template, int slen);


      The mkstemps() function behaves the same as mkstemp(), except it
      permits a suffix to exist in the template. The template should
      be of the form /tmp/tmpXXXXXXsuffix. The slen parameter specifies
      the length of the suffix string.

That looks useful, but why use a signed type for that "slen" parameter?
I'd suggest using size_t if you provide the function, and consider
replacing the above interface.

Then, if it's ever standardized, perhaps they'll get it right.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]