> In message <[EMAIL PROTECTED]> Karl Pielorz writes:
> : I'm writing a program under FreeBSD 3.X that has been forced into having to
> : make a number of rename() calls that must be completed atomically (i.e. all
> : together) without the process being interrupted, or any other process being
> : allowed to run...
>
> If advisory locks won't work (and they almost always will for things
> like this), then you could walk the process tree. For all processes
> that aren't suspended or yourself, send a SIGSTOP, keep a list. Keep
> going through the tree while you keep finding processes. SIGSTOP
> can't be caught or blocked, so you know you've stopped them). Do your
> operation, then send SIGCONT to all the processes that you sent a
> SIGSTOP to. Of course, this will likely be much harder than doing
> advisory locking, but might be a way that you might be able to exactly
> what you want.
Wow, forgive me for saying this, but it must take a warped mind to
think of that !!! :-)
Now if the original poster could arrange that all the files are
either in the same directory or symlinked to the same directory, a
quick directory rename (or symlink move) may do the job. If that's
not atomic enough, you could always replace that chunk of filesystem
with a mount().
> Warner
>
> P.S. Can you tell I'm partial to advisory locks?
--
Brian <[EMAIL PROTECTED]> <brian@[uk.]FreeBSD.org>
<http://www.Awfulhak.org> <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message