Subject: Fix ".. " semantic project (Was =?WINDO..)
To: None <tech-kern@netbsd.org>
From: Jean-Baptiste Campesato <camjelemon@gmail.com>
List: tech-kern
Date: 03/04/2007 21:27:54
Hello,
Sorry for the subject in my first mail, I think it's because I pasted
the title of the project from netbsd.org which had a special char... I hope
this subject will be good.

2007/3/3, Andrew Reilly <andrew-netbsd@areilly.bpc-users.org>:
> The link above contains the following link to the paper:
> http://cm.bell-labs.com/sys/doc/lexnames.html
>
> That goes to a page that says that the document was not found.
> Do you have a more recent/active link?  (Should update the netbsd
> projects page with it, too.)
>

This link works well here.
I copied a HTML and PDF version to http://zulzul.free.fr/camje/

In brief, when you chdir to a symlink (eg: /home/camje_lemon/test/
which points to /home/camje_lemon/netbsd/code/) getcwd will return the
pointed node path (/home/camje_lemon/netbsd/code/) and a chdir to ..
will set your pwd to the parent node of the pointed node
(/home/camje_lemon/netbsd/).
This project modify this comportment and keep the symlink in the pwd:
a chdir to /home/camje_lemon/test/ sets your pwd to
/home/camje_lemon/test/ and a chdir .. after sets your pwd to
/home/camje_lemon/ .

Jean-Baptiste Campesato

My original post (was
=?WINDOWS-1252?Q?Fix_=93..=94_semantics_project?= in netbsd archive):
2007/3/2, Jean-Baptiste Campesato <camjelemon@gmail.com>:
> Hello,
>
> I've finished to implement a "first draft" of a Plan 9-like getcwd as
> described in Rob Pike's paper:
> http://www.netbsd.org/contrib/projects.html#dotdot
>
> I added a char[] called cwdi_cwd in cwdinfo. cwdi_cwd is modified by a
> chdir, a fchdir, a chroot, a fchroot, or after a mount modifying
> cwdi_cdir (checkdirs()).
> If the pwd isn't modified by a chdir, I set cwdi_cwd to "." (In this
> case getcwd will use the old method: getting the path from the vnode).
> I modified init to put "." in cwdi0.cwdi_cwd and cwdinit() to copy
> cwdi_cwd from the parent process to the new process.
> If cwdi_cwd begins by /, getcwd cleans it (delete ./, ../, //) and
> sends it to userland.
> These modifications are active only if DOTDOT is defined.
>
> I hope that I forgot nothing.
>
> For tiny computer this system should be disabled: cwdi_cwd adds 1kb per process.
> I have to work on error management and KNF now.
> I'm not sure that I use well getcwd_common in cwdclean (No problem for
> the moment)...
>
> It seems that this getcwd isn't POSIX compliant (But ksh uses a
> builtin Plan 9-like pwd...):
> http://www.opengroup.org/onlinepubs/000095399/functions/getcwd.html
> "The pathname copied to the array shall contain no components that are
> symbolic links."
> Maybe creating a new getcwd function would be better ? (eg: getcwdd...)
> Or aborting this project ?
>
> The diff file is located here: http://zulzul.free.fr/camje/dotdot.diff
>
> Thanks,
> Jean-Baptiste Campesato.
>