Subject: Re: utmp file format change
To: Bill Studenmund <wrstuden@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 09/26/2001 18:44:50
>> >True, but since you have to give open a path, you can follow it with a
>> >call to unlink().
>>
>> but i still have to worry about racing someone to opening a file with
>> a random name that i only want for a short time.  i was thinking of
>> something like tmpfile(), but different in that (a) it returned a file
>> descriptor and not a FILE*, and (b) the name never gets created so
>> there's no need to follow it immediately by a call to unlink().
>
>fileno will get around (a). There is no way with our current file systems
>to get around (b), though tmpfile() does it for you.

right.  i was thinking of smoething a little more silly like

	int f = open(NULL, O_RDWR|O_CREAT|O_UNLINK, 0);

which would give me back something that had a link count of zero.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."