mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 19:09:58 +08:00
80a21be075
* 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.
21 lines
286 B
C
21 lines
286 B
C
#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);
|
|
}
|