Darwin does not have mremap. Use munmap+mmap instead.
That code is not in a hot path, number of nodes do not change very
often.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Simple usage improvement.
If only one process using spice is present allow to call
reds_stat not passing any pid.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
Due to alignment problems the structure of statistics file is
different between 32 and 64 bit. This as on 32 bit uint64_t is
aligned to 4 bytes instead of 8 so sizeof(SpiceStat) can be either
20 (32 bit) or 24 (64 bit).
This cause reds_stat utility to be bit dependent.
Detect the correct SpiceStat size and use that information.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
There's no reason for so hard optimisations so avoid
having to maintain multiple labels.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Some non-Linux platforms return a (caddr_t *) result for the return
value of mmap(), which is very unfortunate. Add a (void *) cast to
explicitly avoid the warning when compiling with -Werror.
For the IO vector related stuff, signed vs. unsigned comes into play so
adding a (void *) cast here is technically correct for all platforms.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>