Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-07-27 01:44:34 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-07-27 01:44:34 +0400
commit80a21be075c570bb82bc3a2ed9d805daa35f926b (patch)
tree94ad57790fede9329ec6ebd2dcd09b84e9c2d470 /newlib/libc/sys/linux/getwd.c
parent6b3c247d078c8f5787db0628b5e0f02fbffdeba9 (diff)
2002-07-26 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/param.h (MAX, MIN): Added macros. * libc/sys/linux/Makefile.am: Add new files. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/sys/stat.h: Add *stat64 prototypes. * libc/sys/linux/inode.c (fchdir): Added syscall. * libc/sys/linux/ftw.c: New file. * libc/sys/linux/ftw64.c: Ditto. * libc/sys/linux/getwd.c: Ditto. * libc/sys/linux/scandir64.c: Ditto. * libc/sys/linux/strverscmp.c: Ditto. * libc/sys/linux/versionsort.c: Ditto. * libc/sys/linux/versionsort64.c: Ditto.
Diffstat (limited to 'newlib/libc/sys/linux/getwd.c')
-rw-r--r--newlib/libc/sys/linux/getwd.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/newlib/libc/sys/linux/getwd.c b/newlib/libc/sys/linux/getwd.c
new file mode 100644
index 000000000..72db33830
--- /dev/null
+++ b/newlib/libc/sys/linux/getwd.c
@@ -0,0 +1,20 @@
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+char *
+getwd (char *buf)
+{
+ char tmp[MAXPATHLEN];
+
+ if (buf == NULL)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ if (getcwd (tmp, MAXPATHLEN) == NULL)
+ return NULL;
+
+ return strncpy (buf, tmp, MAXPATHLEN);
+}