summaryrefslogtreecommitdiff
path: root/src/pwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pwd.c')
-rw-r--r--src/pwd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pwd.c b/src/pwd.c
new file mode 100644
index 0000000..b884933
--- /dev/null
+++ b/src/pwd.c
@@ -0,0 +1,17 @@
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ char buf[1024];
+
+ if(!getcwd(buf, sizeof(buf))) {
+ perror("Error getting current directory");
+ return EXIT_FAILURE;
+ }
+
+ puts(buf);
+ return 0;
+}