>From d7f9d40777d1ed7c9450b0be4f957da2993dfc72 Mon Sep 17 00:00:00 2001 From: David Carlier <devne...@gmail.com> Date: Fri, 12 Jun 2020 09:39:17 +0100 Subject: [PATCH] util/getauxval: Porting to FreeBSD getauxval feature
FreeBSD has a similar API for auxiliary vector. Signed-off-by: David Carlier <devne...@gmail.com> --- util/getauxval.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util/getauxval.c b/util/getauxval.c index 36afdfb9e6..b124107d61 100644 --- a/util/getauxval.c +++ b/util/getauxval.c @@ -98,6 +98,16 @@ unsigned long qemu_getauxval(unsigned long type) return 0; } +#elif defined(__FreeBSD__) +#include <sys/auxv.h> + +unsigned long qemu_getauxval(unsigned long type) +{ + unsigned long aux = 0; + elf_aux_info(type, &aux, sizeof(aux)); + return aux; +} + #else unsigned long qemu_getauxval(unsigned long type) -- 2.27.0 On Fri, 12 Jun 2020 at 08:13, Laurent Vivier <laur...@vivier.eu> wrote: > > Le 11/06/2020 à 23:10, David CARLIER a écrit : > > > Hi, > > please don't put your patch in attachements, you can use "git > send-email" if your emailer doesn't allow it. > > https://wiki.qemu.org/Contribute/SubmitAPatch#Do_not_send_as_an_attachment > > I think your patch is not correct, you put a "#if defined(__linux__)" in > a block that is followed by "#elif defined(__linux__)" and there is no > return value if none of the "defined()" is true. > > I think you should not modify the configure and add directly a "#if > defined(__FreeBSD__)" at the beginning of getauxval.c to define your > function. > > Thanks, > Laurent