Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.cis.okstate.edu!news.ksu.ksu.edu!news.physics.uiowa.edu!math.ohio-state.edu!howland.reston.ans.net!newsfeed.internetmci.com!EU.net!Germany.EU.net!zib-berlin.de!news.tu-chemnitz.de!irz401!uriah.heep!news From: j@uriah.heep.sax.de (J Wunsch) Newsgroups: comp.unix.bsd.freebsd.misc,comp.unix.bsd.386bsd.misc,comp.unix.programmer,comp.unix.questions,comp.unix.internals Subject: Re: revoke() system call Date: 22 Jan 1996 22:59:51 GMT Organization: Private BSD site, Dresden Lines: 80 Message-ID: <4e14t7$bps@uriah.heep.sax.de> References: <4dg7g3$mnm@news.xs4all.nl> <4dhl4j$r9@uriah.heep.sax.de> <4do65j$973@hp01.redwood.nl> Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) NNTP-Posting-Host: localhost.heep.sax.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: knews 0.9.3 Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:12660 comp.unix.bsd.386bsd.misc:256 comp.unix.programmer:33153 comp.unix.questions:76058 comp.unix.internals:9592 rob@redwood.nl (Rob J. Nauta) writes: > I've grabbed pty.c and it works except that I am missing > -> revoke(). > >Hmmmmm, it _is_ there: > > >j@uriah 57% nm /usr/lib/libc.a | fgrep revoke > >00000008 T _revoke > > Hmm I may have said it the wrong way, what I meant was that I grabbed > some 4.4BSD source, and am trying to compile it on HP-UX10... Sorry, i misunderstood. From a quick glance over the sources, revoke works as follows: it looks up the object pointed at by its argument it checks that the euid is that of superuser it checks that the associated vnode is in use, or is aliased (don't ask me for _that_ detail) it calls vgoneall() for it vgoneall() is: /* * Eliminate all activity associated with the requested vnode * and with all vnodes aliased to the requested vnode. */ void vgoneall(vp) register struct vnode *vp; ..which finally calls vgone(): /* * Eliminate all activity associated with a vnode * in preparation for reuse. */ void vgone(vp) register struct vnode *vp; Here are the comments from inside vgone(), just to get you the picture. /* * If a vgone (or vclean) is already in progress, wait until it is * done and return. */ /* * Clean out the filesystem specific data. */ /* * Delete from old mount point vnode list, if on one. */ /* * If special device, remove it from special device alias list. */ /* * If it is on the freelist and not already at the head, move it to * the head of the list. The test of the back pointer and the * reference count of zero is because it will be removed from the free * list by getnewvnode, but will not have its reference count * incremented until after calling vgone. If the reference count were * incremented first, vgone would (incorrectly) try to close the * previous instance of the underlying object. So, the back pointer is * explicitly set to `0xdeadb' in getnewvnode after removing it from * the freelist to ensure that we do not try to move it here. */ -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)