ref: ed9fdc72f519553f9c8f1f221f97bd5919847caa
dir: /sys/src/cmd/pwd.c/
#include <u.h> #include <libc.h> /* * Print working (current) directory */ void main(int argc, char *argv[]) { char pathname[512]; USED(argc, argv); if(getwd(pathname, sizeof(pathname)) == 0) { fprint(2, "pwd: %r\n"); exits("getwd"); } print("%s\n", pathname); exits(0); }