[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libguestfs
Subject:    Re: [Libguestfs] [PATCH nbdkit] freebsd, openbsd: Add an extern decl for environ.
From:       Eric Blake <eblake () redhat ! com>
Date:       2020-04-28 16:03:51
Message-ID: a7a0a4b6-e84d-2619-a261-27a6a6e713fb () redhat ! com
[Download RAW message or body]

On 4/28/20 10:43 AM, Richard W.M. Jones wrote:
> ---
>   configure.ac      | 24 ++++++++++++++++++++++++
>   plugins/sh/call.c |  4 ++++
>   2 files changed, 28 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index cdddae73..9b925539 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -266,6 +266,30 @@ test (int a)
>       ]
>   )
>   
> +dnl 'environ' is not always declared in public header files:
> +dnl Linux => <unistd.h>  Haiku => <stdlib.h>
> +dnl FreeBSD & OpenBSD => not declared

POSIX says that a user must declare 'environ' themselves (the only POSIX 
public entry point with that odd requirement); any system that provides 
it via a header is merely being nice, and should only do so when 
extensions are requested (but we always request extensions).

We could either do this conditionally (as you have done here) or blindly 
(but then risk collisions if our declaration doesn't quite match the 
systems that DO provide it via public headers as an extension), so I 
like your approach.

ACK.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic