source: trunk/src/emx/src/lib/misc/getwd.c@ 18

Last change on this file since 18 was 18, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 469 bytes
Line 
1/* getwd.c (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes */
2
3#include <stdlib.h>
4#include <string.h>
5#include <errno.h>
6#include <sys/param.h>
7#include <emx/syscalls.h>
8
9char *_getwd (char *buffer)
10{
11 if (buffer == NULL)
12 {
13 errno = EINVAL;
14 return NULL;
15 }
16 if (__getcwd (buffer+1, 0) < 0)
17 {
18 _strncpy (buffer, strerror (errno), MAXPATHLEN);
19 return NULL;
20 }
21 _fnslashify (buffer+1);
22 buffer[0] = '/';
23 return buffer;
24}
Note: See TracBrowser for help on using the repository browser.