Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 1995 17:20:44 -0800 (PST)
From:      "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com>
To:        peter@bonkers.taronga.com (Peter da Silva)
Cc:        hackers@FreeBSD.org
Subject:   Re: MIT SHM X11 extensions? (fwd)
Message-ID:  <199502110120.RAA25167@gndrsh.aac.dev.com>
In-Reply-To: <199502110003.SAA23105@bonkers.taronga.com> from "Peter da Silva" at Feb 10, 95 06:03:35 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > Actually, you could fault the whole image to swap and close the
> > reference to the file -- and just allow the write, with never an
> > ETXTBUSY to be seen.
> 
> I consider the sudden explosion of swap utilization to be a surprising
> consequence, especially considering the size of some images. When you're
> writing to an image you're likely replacing it with "install" anyway.
> Let "install" detect the ETXTBSY and do a little shuffle.

Install always does an unlink so it handles this problem just fine:

                /*
		 * Unlink now... avoid ETXTBSY errors later.  Try and turn
		 * off the append/immutable bits -- if we fail, go ahead,
		 * it might work.
		 */  
#define NOCHANGEBITS    (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)
		if (to_sb.st_flags & NOCHANGEBITS)
			(void)chflags(to_name,
			    to_sb.st_flags & ~(NOCHANGEBITS));
			(void)unlink(to_name);
		}

-- 
Rod Grimes                                      rgrimes@gndrsh.aac.dev.com
Accurate Automation Company                   Custom computers for FreeBSD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502110120.RAA25167>