Kevin Day wrote:
> 
> >
> > Kevin Day wrote:
> > >
> > > I mmap() files in, then copy them to a device. This works great except when
> > > someone tries to change that file during the copy. If the size of the file
> > > shrinks, I'll SIGBUS or SIGSEGV when i try to touch past the new file size.
> > > So, i setup a signal handler and longjmp into some recovery code.
> > >
> > > Perhaps there's a better way, but I don't consider this a bug really, and
> > > i'll get a SEGV. :)
> >
> > MAP_PRIVATE?
> >
> 
> This has the undesired effect of me not noticing that the file changed then.

stat(2) it after the copy?  OK, I'm reaching.  Handling SEGV seems like a
rather iffy solution at best.

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
[EMAIL PROTECTED]                                           http://softweyr.com/


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to