static int check_shm_size(IVShmemState *s, int fd) {

    /* check that the guest isn't going to try and map more memory than the

     * the object has allocated return -1 to indicate error */



    struct stat buf;



    fstat(fd, &buf);



    if (s->ivshmem_size > buf.st_size) {

        fprintf(stderr,

                "IVSHMEM ERROR: Requested memory size greater"

                " than shared object size (%" PRIu64 " > %" PRIu64")\n",

                s->ivshmem_size, (uint64_t)buf.st_size);

        return -1;

    } else {

        return 0;

    }

}

static int check_shm_size(IVShmemState *s, int fd) {

    





    struct stat buf;



    fstat(fd, &buf);



    if (s->ivshmem_size > buf.st_size) {

        fprintf(stderr,

                "IVSHMEM ERROR: Requested memory size greater"

                " than shared object size (%" PRIu64 " > %" PRIu64")\n",

                s->ivshmem_size, (uint64_t)buf.st_size);

        return -1;

    } else {

        return 0;

    }

}

    fstat(fd, &buf);
static int FUNC_0(IVShmemState *VAR_0, int VAR_1) {

    





    struct stat VAR_2;



    fstat(VAR_1, &VAR_2);



    if (VAR_0->ivshmem_size > VAR_2.st_size) {

        fprintf(stderr,

                "IVSHMEM ERROR: Requested memory size greater"

                " than shared object size (%" PRIu64 " > %" PRIu64")\n",

                VAR_0->ivshmem_size, (uint64_t)VAR_2.st_size);

        return -1;

    } else {

        return 0;

    }

}

static int FUNC_0(IVShmemState *VAR_0, int VAR_1) { struct stat VAR_2; fstat(VAR_1, &VAR_2); if (VAR_0->ivshmem_size > VAR_2.st_size) { fprintf(stderr,
"IVSHMEM ERROR: Requested memory size greater"
" than shared object size (%" PRIu64 " > %" PRIu64")\n",
VAR_0->ivshmem_size, (uint64_t)VAR_2.st_size); return -1; } else { return 0; } }