10.46.74 unsetenv
¶
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/unsetenv.html
Gnulib module: unsetenv
Portability problems fixed by Gnulib:
- This function is missing on some platforms:
AIX 5.1, HP-UX 11.23, Solaris 9, mingw, MSVC 14.
- This function has the return type ‘void’ instead of ‘int’ on some
platforms:
FreeBSD 6.0, NetBSD 1.6, OpenBSD 3.8.
- On some platforms, this function does not fail with ‘EINVAL’ when
passed an empty string or a string containing ‘=’:
FreeBSD 6.0, NetBSD 1.6, OpenBSD 4.7.
- This function removes only the first value association for the given
environment variable, not all of them, on some platforms:
Solaris 11.4, Haiku.
Portability problems not fixed by Gnulib:
- Older versions of POSIX required that
unsetenv(NULL)
gracefully
fail with EINVAL
, but not all implementations guarantee this,
and the requirement was removed.