Subject: Re: funlink() for fun!
To: NetBSD Kernel Technical Discussion List <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 07/12/2003 16:52:03
>> The former [including open] have obvious f* analogs, though the f*
>> analog of open() doesn't exist (no, it's not dup(2)).
> There can be no fopen() analog of open(),

Why not?  I see no reason the kernel couldn't duplicate the open file
table entry and return a file descriptor on the duplicate.  (This would
differ from dup() in that they share less - for example, dup()ed
descriptors share seek pointers with the originals; this wouldn't.)

>> The latter would need directory-fd-and-string pairs to have real f*
>> analogs.
> No, they don't really -- fchdir() is still the best solution (even if
> it does mean adding O_NOACCESS and/or openpwd())

chdir() was one of "the former".

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B