mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Added pwd(1).
This commit is contained in:
parent
b4f47f0f79
commit
081bb6481c
2 changed files with 13 additions and 0 deletions
|
@ -14,6 +14,7 @@ sh \
|
|||
mxsh \
|
||||
clear \
|
||||
ls \
|
||||
pwd \
|
||||
help \
|
||||
uptime \
|
||||
memstat \
|
||||
|
|
12
utils/pwd.cpp
Normal file
12
utils/pwd.cpp
Normal 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;
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue