source: trunk/libs/newlib/src/newlib/libc/sys/linux/getwd.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 286 bytes
Line 
1#include <string.h>
2#include <unistd.h>
3#include <errno.h>
4
5char *
6getwd (char *buf)
7{
8  char tmp[MAXPATHLEN];
9
10  if (buf == NULL)
11    {
12      errno = EINVAL;
13      return NULL;
14    }
15
16  if (getcwd (tmp, MAXPATHLEN) == NULL)
17    return NULL;
18
19  return strncpy (buf, tmp, MAXPATHLEN);
20}
Note: See TracBrowser for help on using the repository browser.