[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools) |
Date: |
Thu, 13 Jul 2017 15:12:26 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/13/2017 01:40 PM, Kamil Rytarowski wrote:
>> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$((RANDOM % 255 + 1))} gtester -k
>> --verbose -m=quick tests/check-qdict
>> sh: arith: syntax error: "RANDOM % 255 + 1"
>>
>> likely because we're using a bashism there.
Yes, assuming that $RANDOM exists is a bashism.
>>
>
> This is an extension to a POSIX shell. We were lately adding it as an
> extension to our sh(1) in the distribution. Were also thinking about
> prompting POSIX to standarize it.
>
> $ echo $((RANDOM % 255))
> 52
>
> As of now, one portable solution is to parse /dev/urandom, or use a 3rd
> party tool like awk(1).
It's also portable (although less random) to do:
$(( ${RANDOM:-0} + 1))
(the whole idea of MALLOC_PERTURB_ only works on glibc anyways, so it
really doesn't matter what you set it to on other systems).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools), Peter Maydell, 2017/07/13
- [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools), Peter Maydell, 2017/07/14
- [Qemu-devel] [PATCH 1/3] configure: Rename CONFIG_IVSHMEM to CONFIG_IVSHMEM_DEVICE, Peter Maydell, 2017/07/14
- [Qemu-devel] [PATCH 2/3] configure: Use an explicit CONFIG_IVSHMEM rather than CONFIG_EVENTFD, Peter Maydell, 2017/07/14
- [Qemu-devel] [PATCH 3/3] configure: Don't build ivshmem tools unless CONFIG_IVSHMEM is set, Peter Maydell, 2017/07/14
- Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools), Peter Maydell, 2017/07/20
- Re: [Qemu-devel] [PATCH 0/3] Fix NetBSD build (don't build ivshmem tools), Markus Armbruster, 2017/07/20