From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Ahern To: 9fans@cse.psu.edu Subject: Re: [9fans] book chapters Message-ID: <20030627223623.GA31591@wilbur.25thandClement.com> References: <001601c33c91$249f4cd0$2a8be793@gli.cas.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i Date: Fri, 27 Jun 2003 15:36:23 -0700 Topicbox-Message-UUID: df9f9b5c-eacb-11e9-9e20-41e7f4b1d025 On Fri, Jun 27, 2003 at 06:08:13PM -0400, Joel Salomon wrote: > On Fri, 27 Jun 2003, pac wrote: > * Unix Assumes a Static File System > I'm out of my depths here - anyone able to answer this? Linux has this solution *wrong*. the DNOTIFY mechanism is accessed thru fcntl(), and DNOTIFY uses signals. ugh! I don't know if BSD _copied_ Linux. The free BSD's have kqueue(), which is an interface that smoothes over file descriptors, signals, process status and async-io context pointers. It includes a mechanism to be notified on all file events. DNOTIFY on Linux only notifies on directories (tho it will trigger a directory event when children are modified). However, Linux might get epoll(), which is supposed to be similar to Solaris' /dev/poll, but a tad more general. It looks similar to kqueue(), but not nearly as robust. (for better or worse) I'm working on a shell utility, `watch', which outputs file event notifications. The code is ugly, because I ran into a lot of caveats figuring out the semantics of kqueue vnode events. [http://www.25thandclement.com/~william/projects/watch.html] I guess one tie-in to Plan 9 is that none of the BSD's (free ones, at least) keep track of path names in their fs layer. Linux does, and in fact on Linux /dev/pid/[fd] is analagous to fd2path(), except Linux tracks rename()s. Ted Unangst, an OpenBSD developer, wrote me to say that he might hack OpenBSD to keep some path info. I talked to him about it because if I'm monitoring a large tree for events (say in a CMS), kqueue() forces me to open every last file, while in Linux I need only open every directory; the issue being descriptor table limits. - Bill