*BSD News Article 12722


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!uuneo!sugar!peter
From: peter@NeoSoft.com (Peter da Silva)
Subject: Re: A challenge to all true kernel hackers - conditional symlinks.
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Thu, 11 Mar 1993 23:19:30 GMT
Message-ID: <C3qzGI.38q@sugar.neosoft.com>
References: <JKH.93Mar9214944@whisker.lotus.ie> <C3ow4H.FID@BitBlocks.com>
Lines: 35

In article <C3ow4H.FID@BitBlocks.com> bvs@BitBlocks.com (Bakul Shah) writes:
> Currently $, ( and ) are ordinary filename characters.

How about using "//" within a symlink to indicate that the next component
is a name?

	ln -s /usr/i18n//lang/docs /usr/docs

> - Create a new system call open1() that takes a file-descriptor
>   of a directory and a path. Change things so that each process gets
>   file-descriptors for `/' and the current directory (perhaps as
>   `well-known' constants).

I've written about a very slight variant of this idea before. It goes a bit
further: make this the basic open call, and have open simply call this with
the appropriate arguments. Make all calls based on these file descriptor
based variants. Programs that had to grovel around directory trees would be
able to use dup() to save their original home directory, which would much
simplify them. You'd get rid of 90% of the calls to getcwd().

I'd still rather have namei() in the kernel, so you could have it do smarter
things than it does now. For example, when it gets to a mount point it should
just ditch the whole rest of the path to the remote system to resolve. You
could also mount programs and get them to handle fancy stuff like

	/dev/com1/9600,n,8,1

> On the negative side you make a few more system calls.

	A *lot* more.
-- 
Peter da Silva.  <peter@sugar.neosoft.com>.
 `-_-'   Oletko halannut suttasi tänään?
  'U`    
Tarjoilija, tämä ateria elää vielä.