1 #include <err.h> 2 #include <errno.h> 3 #include <unistd.h> 4 5 char* getcwd(char * buf,size_t buflen)6getcwd(char* buf, size_t buflen) 7 { 8 errno = ENOSYS; 9 return NULL; 10 } 11 int main(void)12main(void) 13 { 14 char buf[256]; 15 if (getcwd(buf, sizeof buf) == NULL) 16 err(1, "getcwd failed"); 17 return 0; 18 } 19