Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/linuxemu/libc/linux/9/getwd.c
#include <u.h> #include <libc.h> #include "../syscall/syscall.h" char* getwd(char *buf, int len) { if(linuxgetcwd(buf, len) < 0) // if error is ERANGE, copy our own. XXX return nil; return buf; }