home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
LIBSRC.ZOO
/
libsrc
/
local
/
getcwd.c
< prev
next >
Wrap
Text File
|
1992-04-03
|
465b
|
30 lines
#define INCL_DOSFILEMGR
#include <os2.h>
#include <errno.h>
ULONG Dos32QueryCurrentDir() asm ("Dos32QueryCurrentDir");
char *getcwd (char *buf, int size)
{
char *tbuf = buf;
int tsize = size;
ULONG rc;
if (tbuf == NULL)
{
tbuf = (char *) malloc (2048);
tsize = 2048;
}
rc = Dos32QueryCurrentDir (0, tbuf, &tsize);
if (rc)
{
errno = EIO;
return (NULL);
}
return (tbuf);
}