Subject: Re: O_NOACCESS opens?
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 05/31/2003 02:03:40
I wrote...

> I want to save and restore my current directory by opening "." before
> changing and then fchdir(2)ing back afterwards.  [...]

This brings up another point: I'd like a way to get a fd onto the
current directory without depending on lookups working.  In particular,
if the current directory has been removed, a lookup for "." won't work
even though the directory is still the cwd and hence still exists.

I'm tmepted to say that opening "" with O_EXONLY or O_NOACCESS or
whatever should do this.  (There's a comment in namei saying that POSIX
says "" is not a valid path, but O_NOACCESS or whatever would be an
extension anyway; "" could be declared a valid path, referring to cwd,
when that bit is specified, couldn't it?)

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