>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>> On systems with openat(), would it not be possible to resolve
>> symlinks without ever needing chdir?
Tom> Um ... AFAICS, openat() just opens a file, it doesn't give back a
Tom> resolved path. Did you mean readlinkat()?
No, what I meant was that if you have openat() (and fstatat() and
fdopendir()), you can do what getcwd does except starting with some
arbitrary directory other than the current one. So the current logic of
"chdir through all symlinks, then do getcwd to find where we landed"
would not be necessary.
--
Andrew (irc:RhodiumToad)