]> sourceware.org Git - newlib-cygwin.git/commitdiff
* include/cygwin/stdlib.h: New file.
authorChristopher Faylor <me@cgf.cx>
Mon, 5 Dec 2005 22:30:03 +0000 (22:30 +0000)
committerChristopher Faylor <me@cgf.cx>
Mon, 5 Dec 2005 22:30:03 +0000 (22:30 +0000)
* environ.cc (unsetenv): Change to return -1 on input error.
* include/cygwin/version.h: Add more description to latest api bump.

winsup/cygwin/ChangeLog
winsup/cygwin/environ.cc
winsup/cygwin/include/cygwin/stdlib.h [new file with mode: 0644]
winsup/cygwin/include/cygwin/version.h

index 2c18ff8e22a02725f6bc487910373a75424b271f..151597dbde3e8af44ac033a77a88f46e85d528c8 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-05  Christopher Faylor  <cgf@timesys.com>
+
+       * include/cygwin/stdlib.h: New file.
+       * environ.cc (unsetenv): Change to return -1 on input error.
+       * include/cygwin/version.h: Add more description to latest api bump.
+
 2005-12-05  Christopher Faylor  <cgf@timesys.com>
 
        * dir.cc (readdir_workdir): Only fill out d_ino when linked into older
index e7bd292c79b47ea7f3a057aa4f95254d9a2c2eca..af950dd0564478cb6ef6302a632c9592d4ccc490 100644 (file)
@@ -362,17 +362,25 @@ setenv (const char *name, const char *value, int overwrite)
 }
 
 /* unsetenv(name) -- Delete environment variable "name".  */
-extern "C" void
+extern "C" int
 unsetenv (const char *name)
 {
   register char **e;
   int offset;
+  myfault efault;
+  if (efault.faulted () || *name == '\0' || strchr (name, '='))
+    {
+      set_errno (EINVAL);
+      return -1;
+    }
 
   while (my_findenv (name, &offset))   /* if set multiple times */
     /* Move up the rest of the array */
     for (e = cur_environ () + offset; ; e++)
       if (!(*e = *(e + 1)))
        break;
+
+  return 0;
 }
 
 /* Turn environment variable part of a=b string into uppercase. */
diff --git a/winsup/cygwin/include/cygwin/stdlib.h b/winsup/cygwin/include/cygwin/stdlib.h
new file mode 100644 (file)
index 0000000..5eb707a
--- /dev/null
@@ -0,0 +1,61 @@
+/* stdlib.h
+
+   Copyright 2005 Red Hat Inc.
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _CYGWIN_STDLIB_H
+#define _CYGWIN_STDLIB_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+const char *getprogname (void);
+void   setprogname (const char *);
+
+#ifndef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int unsetenv (const char *);
+int random (void);
+long srandom (unsigned);
+char *ptsname (int);
+int grantpt (int);
+int unlockpt (int);
+#endif /*__STRICT_ANSI__*/
+
+#undef _malloc_r
+#define _malloc_r(r, s) malloc (s)
+#undef _free_r
+#define _free_r(r, p) free (p)
+#undef _realloc_r
+#define _realloc_r(r, p, s) realloc (p, s)
+#undef _calloc_r
+#define _calloc_r(r, s1, s2) calloc (s1, s2);
+#undef _memalign_r
+#define _memalign_r(r, s1, s2) memalign (s1, s2);
+#undef _mallinfo_r
+#define _mallinfo_r(r) mallinfo ()
+#undef _malloc_stats_r
+#define _malloc_stats_r(r) malloc_stats ()
+#undef _mallopt_r
+#define _mallopt_r(i1, i2) mallopt (i1, i2)
+#undef _malloc_usable_size_r
+#define _malloc_usable_size_r(r, p) malloc_usable_size (p)
+#undef _valloc_r
+#define _valloc_r(r, s) valloc (s)
+#undef _pvalloc_r
+#define _pvalloc_r(r, s) pvalloc (s)
+#undef _malloc_trim_r
+#define _malloc_trim_r(r, s) malloc_trim (s)
+#undef _mstats_r
+#define _mstats_r(r, p) mstats (p)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*_CYGWIN_STDLIB_H*/
index d40dd878646213b929714db01c23b4323b5bb624..db65e43a44cea015b8b7dca82f56def9b16ea6ca 100644 (file)
@@ -280,7 +280,8 @@ details. */
       145: Add MAP_NORESERVE flag to mmap.
       146: Change SI_USER definition.  FIXME: Need to develop compatibility macro
            for this?
-      147: Eliminate problematic d_ino from dirent structure.
+      147: Eliminate problematic d_ino from dirent structure.  unsetenv now returns
+           int, as per linux.
      */
 
      /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
This page took 0.043504 seconds and 5 git commands to generate.