micro-utils/coreutils/pwd.c

20 lines
269 B
C
Raw Permalink Normal View History

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
int main(void) {
char cwd[PATH_MAX];
if (getcwd(cwd, sizeof(cwd)))
puts(cwd);
else {
fprintf(stderr, "pwd: %s\n", strerror(errno));
return 1;
}
return 0;
}