[vlc-devel] [PATCH] compat: add pread

Rémi Denis-Courmont remi at remlab.net
Thu Jan 7 17:53:03 CET 2016


On Thursday 07 January 2016 15:10:10 Steve Lhomme wrote:
> On Thu, Jan 7, 2016 at 2:50 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> > Le 2016-01-07 15:26, Steve Lhomme a écrit :
> >> +#include <io.h>
> > 
> > ??
> > 
> >> +
> >> +ssize_t pread (int fd, void *buf, size_t count, off_t offset)
> >> +{
> >> +    if ( lseek (fd, offset, SEEK_SET) != offset ) {
> >> +        return -1;
> >> +    }
> >> +    return read( fd, buf, count );
> >> +}
> > 
> > This is not how I understand pread() to (be supposed to) work.
> 
> I'm fine with dropping the non _WIN32 part of the patch. It will be
> equivalent to what we have now.

The Windows version is not correct either. I wouldn´t expose it.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list