blob: f47e15081b455607f27533e8519ae6c7449dc9c0 [file] [log] [blame]
// RUN: test.sh -p -t %t %s
#include <assert.h>
#include <errno.h>
#include <unistd.h>
//
// Example of using getcwd() with error conditions.
//
int main() {
char buf[1], *cwd;
chdir("/");
cwd = getcwd(buf, sizeof(buf));
assert(cwd == NULL);
assert(errno == ERANGE);
return 0;
}