OSDN Git Service

* winsup.api/nullgetcwd.c: New file. Check that NULL first argument to getcwd
authorcgf <cgf>
Fri, 5 Oct 2001 16:52:42 +0000 (16:52 +0000)
committercgf <cgf>
Fri, 5 Oct 2001 16:52:42 +0000 (16:52 +0000)
works.

winsup/testsuite/ChangeLog
winsup/testsuite/winsup.api/nullgetcwd.c [new file with mode: 0644]

index 54ebc5c..1d39325 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct  5 11:15:55 2001  Christopher Faylor <cgf@cygnus.com>
+
+       * winsup.api/nullgetcwd.c: New file.  Check that NULL first argument to
+       getcwd works.
+
 Thu Oct  4 22:47:51 2001  Christopher Faylor <cgf@cygnus.com>
 
        * winsup.api/systemcall.c (main): Change some messages for clarity.
diff --git a/winsup/testsuite/winsup.api/nullgetcwd.c b/winsup/testsuite/winsup.api/nullgetcwd.c
new file mode 100644 (file)
index 0000000..f7d8732
--- /dev/null
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+int
+main (int argc, char *argv)
+{
+  char *cwd = getcwd (NULL, 256);
+  if (cwd == NULL)
+    {
+      fprintf (stderr, "%s: getcwd returns NULL\n", argv[0]);
+      exit (1);
+    }
+
+  exit (0);
+}
+