Source-Changes-D archive

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

Re: putenv/setenv changes



In article <20101003070745.GC23377%apb-laptoy.apb.alt.za@localhost>,
Alan Barrett  <apb%cequrux.com@localhost> wrote:
>On Sat, 02 Oct 2010, Christos Zoulas wrote:
>> >I suggest a BUGS section in putenv(3) stating that that the interface
>> >uses non-const char* for compatibility with POSIX brain damage, but the
>> >implementation guarantees to treat it as read-only.
>> 
>> Actually the string must be writeable because POSIX requires you
>> to use the actual string passed to putenv() inside the environment
>> array.  All strings in the environment array must be writable.
>
>If you mess with the environment using putenv(const string), then you
>should expect the relevant portion to no longer be writable by your
>program; but the implementation can still guarantee that none of the
>putenv/setenv/getenv functions will write to it.

Please read http://www.opengroup.org/onlinepubs/009695399/functions/putenv.html
Note issue 5.

christos



Home | Main Index | Thread Index | Old Index