qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1.1 19/22] block: implement is_allocated for raw


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1.1 19/22] block: implement is_allocated for raw
Date: Wed, 09 May 2012 16:24:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120425 Thunderbird/12.0

Il 09/05/2012 16:10, Kevin Wolf ha scritto:
> > While SEEK_* is not guaranteed by POSIX to be 0/1/2, the values is so
> > old that there may still exist programs that hard-code the values
> > (similar to O_RDONLY/O_WRONLY/O_RDWR, though probably not any other O_*
> > constant).  It would be quite unwise to define them to something else.
> > Even MS-DOS reused the values!
> > 
> > AFAIK this is the only extension of lseek that's ever been added.  It
> > was done on Solaris first and then in Linux and the BSDs.  It used 3/4
> > there too, see for example http://bugs.python.org/msg119551 (Solaris)
> > and http://mail-index.netbsd.org/tech-kern/2011/08/17/msg011231.html
> > (NetBSD).
>
> Why not simply #ifdef the whole code out and fall back to the current
> "everything is allocated" behaviour when SEEK_DATA/HOLE aren't defined?

That would be okay too of course.

When I wrote it Google Code existed still, so I must have taken the
idiom from some place.  Now it doesn't anymore, so I cannot check and
it's okay to keep it safe.  The code is a little bit uglier though.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]