[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FreeBSD has setenv but not clearenv

From: Eric Blake
Subject: Re: FreeBSD has setenv but not clearenv
Date: Wed, 05 Jun 2013 06:13:50 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

On 06/05/2013 03:10 AM, Colin Watson wrote:
> Hi,
> I've had multiple reports (https://savannah.nongnu.org/bugs/?36848,
> https://bugs.gentoo.org/show_bug.cgi?id=244517) telling me that FreeBSD
> is missing the clearenv function, even though it has setenv.  It would
> be very helpful if Gnulib could handle this.  Is "environ = NULL;"
> portable, or does it need something cleverer?

clearenv() is non-standard (it is a glibc extension); but yes, glibc
documents that "environ = NULL" is a portable alternative.  And yes, it
is probably quite easy to write a gnulib module that would provide
clearenv everywhere, although I fail to see why applications need the
overhead of a function call when an assignment would do.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]