Hi,
On 18/10/24 10:20, Aleksandar Rakic wrote:
This patch reverts the commit (with SHA
50290c002c045280f8defad911901e16bfb52884 from
https://github.com/MIPS/gnutools-qemu) that breaks for mingw builds,
where clock_gettime and CLOCK_MONOTONIC are not available.
Isn't get_clock() what we want here?
Cherry-picked d57c735e1af1ca719dbd0c3a904ad70c9c31cbb7
from https://github.com/MIPS/gnutools-qemu
Signed-off-by: Faraz Shahbazker <fshahbaz...@wavecomp.com>
Signed-off-by: Aleksandar Rakic <aleksandar.ra...@htecgroup.com>
---
qemu-io-cmds.c | 77 +++++++++++++++++++++++++-------------------------
1 file changed, 39 insertions(+), 38 deletions(-)
Please Cc maintainers (done now):
$ ./scripts/get_maintainer.pl -f qemu-io-cmds.c
Kevin Wolf <kw...@redhat.com> (supporter:Block layer core)
Hanna Reitz <hre...@redhat.com> (supporter:Block layer core)
@@ -904,7 +905,7 @@ static const cmdinfo_t readv_cmd = {
static int readv_f(BlockBackend *blk, int argc, char **argv)
{
- struct timespec t1, t2;
+ struct timeval t1, t2;
bool Cflag = false, qflag = false, vflag = false;
int c, cnt, ret;
char *buf;
@@ -964,9 +965,9 @@ static int readv_f(BlockBackend *blk, int argc, char **argv)
return -EINVAL;
}
- clock_gettime(CLOCK_MONOTONIC, &t1);
+ gettimeofday(&t1, NULL);
ret = do_aio_readv(blk, &qiov, offset, flags, &total);
- clock_gettime(CLOCK_MONOTONIC, &t2);
+ gettimeofday(&t2, NULL);
if (ret < 0) {
printf("readv failed: %s\n", strerror(-ret));