Added pwd(1).

This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-01 00:27:30 +01:00
parent b4f47f0f79
commit 081bb6481c
2 changed files with 13 additions and 0 deletions

View File

@ -14,6 +14,7 @@ sh \
mxsh \
clear \
ls \
pwd \
help \
uptime \
memstat \

12
utils/pwd.cpp Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
const size_t WDSIZE = 4096;
char wd[WDSIZE];
if ( !getcwd(wd, WDSIZE) ) { perror("getcwd"); return 1; }
printf("%s\n", wd);
return 0;
}