/dev/tty is as we all know quite a hack: it is a variant symlink
is disguise.

I have create a patch which cleans up the way /dev/tty works using
the DEVFS cloning mechanism, and I would like to get feedback on it.


20010513        devtty.patch

        This patch slightly changes the way device cloning works.
        After the cloners have been called we try to find the match
        not by name but by the dev_t the successfull cloner gave us.

        This allows "cloning by a different name" activities.

        The patch to kern/tty_tty.c exploits this feature to remove
        the the magic and bogus /dev/tty device, and instead /dev/tty
        by clone-magic points at the process' controlling terminal.

        (The patch also contains a few cleanups)

        The following difference results:

        Without this patch:

                critter phk> tty
                critter phk> ls -li /dev/ttypd /dev/tty
                 12 crw-rw-rw-  1 root  wheel    1,   0 13 Maj 14:22 /dev/tty
                109 crw--w----  1 phk   tty      5,  13 13 Maj 14:28 /dev/ttypd

        With this patch:

                syv# tty
                syv# ls -li /dev/ttyp0 /dev/tty
                87 crw--w----  1 root  tty    5,   0 May 13 12:27 /dev/tty
                87 crw--w----  1 root  tty    5,   0 May 13 12:27 /dev/ttyp0

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to