Cygwin: Implement the GNU extension clearenv
This commit is contained in:
parent
9234545e3d
commit
defaa2ca31
|
@ -306,6 +306,7 @@ cimag NOSIGFE
|
|||
cimagf NOSIGFE
|
||||
cimagl NOSIGFE
|
||||
cleanup_glue NOSIGFE
|
||||
clearenv SIGFE
|
||||
clearerr SIGFE
|
||||
clearerr_unlocked SIGFE
|
||||
clock SIGFE
|
||||
|
|
|
@ -720,6 +720,26 @@ unsetenv (const char *name)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Clear the environment. */
|
||||
extern "C" int
|
||||
clearenv (void)
|
||||
{
|
||||
__try
|
||||
{
|
||||
if (cur_environ () == lastenviron)
|
||||
{
|
||||
free (lastenviron);
|
||||
lastenviron = NULL;
|
||||
}
|
||||
__cygwin_environ = NULL;
|
||||
update_envptrs ();
|
||||
return 0;
|
||||
}
|
||||
__except (EFAULT) {}
|
||||
__endtry
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Minimal list of Windows vars which must be converted to uppercase.
|
||||
Either for POSIX compatibility of for backward compatibility with
|
||||
existing applications. */
|
||||
|
|
|
@ -26,6 +26,9 @@ char *canonicalize_file_name (const char *);
|
|||
#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
|
||||
int unsetenv (const char *);
|
||||
#endif
|
||||
#if __MISC_VISIBLE
|
||||
int clearenv (void);
|
||||
#endif
|
||||
#if __XSI_VISIBLE
|
||||
char *ptsname (int);
|
||||
int grantpt (int);
|
||||
|
|
Loading…
Reference in New Issue