12
mkdir("writeable", 0777);
13
mkdir("unwriteable", 0111);
23
// currently, the most recent timestamp is shared for atime,
24
// ctime and mtime. using unique values for each in the test
26
struct utimbuf t = {1000000000, 1000000000};
28
utime("writeable", &t);
30
memset(&s, 0, sizeof s);
31
stat("writeable", &s);
32
assert(s.st_atime == t.actime);
33
assert(s.st_mtime == t.modtime);
35
// write permissions aren't checked when setting node
36
// attributes unless the user uid isn't the owner (so
37
// therefor, this should work fine)
38
utime("unwriteable", &t);
40
memset(&s, 0, sizeof s);
41
stat("unwriteable", &s);
42
assert(s.st_atime == t.actime);
43
assert(s.st_mtime == t.modtime);
50
signal(SIGABRT, cleanup);