how tmpname works

the over worked C something or another aryeh at cash.uucp
Mon Oct 1 19:31:28 AEST 1990


>From tmpname(3) or sunos4.1:
>     char *tmpnam (s)
>     char *s;
>     tmpnam() always generates a file name using the  path-prefix
>     defined  as  P_tmpdir in the <stdio.h> header file.  If s is
>     NULL, tmpnam() leaves its result in an internal static  area
>     and  returns  a  pointer  to  that  area.   The next call to
>     tmpnam() will destroy the contents of the area.  If _s is not
>     NULL,  it  is  assumed  to  be the address of an array of at
>     least L_tmpnam bytes, where L_tmpnam is a  constant  defined
>     in  <stdio.h>;  tmpnam() places its result in that array and
>     returns s.

I am to assume if I call tmpname once with a NULL arg and then call it
again with a pointer to char s[...] that it will nuke the old L_tmpnam?
































Sun Release 4.0   Last change: 1 February 1988                  2



-- 
Aryeh Friedman 				aryeh at cash.ucsc.edu or
"ain't bug hunts the funnest"		tsource at watnxt2.ucr.edu



More information about the Comp.lang.c mailing list