static int try_seek_hole(BlockDriverState *bs, off_t start, off_t *data,

                         off_t *hole)

{

#if defined SEEK_HOLE && defined SEEK_DATA

    BDRVRawState *s = bs->opaque;



    *hole = lseek(s->fd, start, SEEK_HOLE);

    if (*hole == -1) {

        return -errno;

    }



    if (*hole > start) {

        *data = start;

    } else {

        /* On a hole.  We need another syscall to find its end.  */

        *data = lseek(s->fd, start, SEEK_DATA);

        if (*data == -1) {

            *data = lseek(s->fd, 0, SEEK_END);

        }

    }



    return 0;

#else

    return -ENOTSUP;

#endif

}

static int try_seek_hole(BlockDriverState *bs, off_t start, off_t *data,

                         off_t *hole)

{

#if defined SEEK_HOLE && defined SEEK_DATA

    BDRVRawState *s = bs->opaque;



    *hole = lseek(s->fd, start, SEEK_HOLE);

    if (*hole == -1) {

        return -errno;

    }



    if (*hole > start) {

        *data = start;

    } else {

        

        *data = lseek(s->fd, start, SEEK_DATA);

        if (*data == -1) {

            *data = lseek(s->fd, 0, SEEK_END);

        }

    }



    return 0;

#else

    return -ENOTSUP;

#endif

}

static int try_seek_hole(BlockDriverState *bs, off_t start, off_t *data,                          off_t *hole)     *hole = lseek(s->fd, start, SEEK_HOLE);     if (*hole == -1) {         return -errno;     if (*hole > start) {     } else {         *data = lseek(s->fd, start, SEEK_DATA);         if (*data == -1) {             *data = lseek(s->fd, 0, SEEK_END);     return 0;
static int FUNC_0(BlockDriverState *VAR_0, off_t VAR_1, off_t *VAR_2,

                         off_t *VAR_3)

{

#if defined SEEK_HOLE && defined SEEK_DATA

    BDRVRawState *s = VAR_0->opaque;



    *VAR_3 = lseek(s->fd, VAR_1, SEEK_HOLE);

    if (*VAR_3 == -1) {

        return -errno;

    }



    if (*VAR_3 > VAR_1) {

        *VAR_2 = VAR_1;

    } else {

        

        *VAR_2 = lseek(s->fd, VAR_1, SEEK_DATA);

        if (*VAR_2 == -1) {

            *VAR_2 = lseek(s->fd, 0, SEEK_END);

        }

    }



    return 0;

#else

    return -ENOTSUP;

#endif

}

static int FUNC_0(BlockDriverState *VAR_0, off_t VAR_1, off_t *VAR_2,
off_t *VAR_3)
{ #if defined SEEK_HOLE && defined SEEK_DATA
BDRVRawState *s = VAR_0->opaque; *VAR_3 = lseek(s->fd, VAR_1, SEEK_HOLE); if (*VAR_3 == -1) { return -errno; } if (*VAR_3 > VAR_1) { *VAR_2 = VAR_1; } else { *VAR_2 = lseek(s->fd, VAR_1, SEEK_DATA); if (*VAR_2 == -1) { *VAR_2 = lseek(s->fd, 0, SEEK_END); } } return 0; #else
return -ENOTSUP; #endif
}