Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
 
4
static char *nsgetwd(char*, int);
5
 
6
char*
7
getwd(char *buf, int nbuf)
8
{
9
	int n, fd;
10
 
11
	fd = open(".", OREAD);
12
	if(fd < 0)
13
		return nil;
14
	n = fd2path(fd, buf, nbuf);
15
	close(fd);
16
	if(n < 0)
17
		return nil;
18
	return buf;
19
}