20 lines
269 B
C
20 lines
269 B
C
#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;
|
|
}
|