[PATCH 0/5] Implement clearenv

Ken Brown kbrown@cornell.edu
Mon Jun 4 19:36:00 GMT 2018

This is a followup to https://cygwin.com/ml/cygwin/2018-05/msg00334.html.

In this patch series I attempt to implement the glibc extension
clearenv().  I also implement glibc's notion of environ==NULL being
shorthand for an empty environment.

Two questions:

1. I haven't yet absorbed what SIGFE means.  I arbitrarily decorated
   clearenv with SIGFE rather than NOSIGFE in common.din, but I don't
   know if that's right.

2. I guarded the declaration of clearenv() with __GNU_VISIBLE, but
   again I'm not sure about this.  On the one hand, clearenv() is a
   GNU extension, so __GNU_VISIBLE would seem to be the right guard.
   On the other hand, glibc declares clearenv() if _DEFAULT_SOURCE is
   defined, so maybe the guard should be relaxed if our goal is to
   emulate Linux.


Ken Brown (5):
  Cygwin: Clarify some code in environ.cc
  Cygwin: Allow the environment pointer to be NULL
  Cygwin: Implement the GNU extension clearenv
  Cygwin: Remove workaround in environ.cc
  Cygwin: Document clearenv

 winsup/cygwin/common.din               |  1 +
 winsup/cygwin/environ.cc               | 45 ++++++++++++++++++++++----
 winsup/cygwin/include/cygwin/stdlib.h  |  1 +
 winsup/cygwin/include/cygwin/version.h |  3 +-
 winsup/cygwin/release/2.10.1           |  1 +
 winsup/doc/posix.xml                   |  1 +
 6 files changed, 44 insertions(+), 8 deletions(-)


More information about the Cygwin-patches mailing list