2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
18 #include <sys/types.h>
25 main(int argc
, char **argv
)
30 char *pn
; /* path name we're dealing with */
34 ("usage: owntest <file owned by somoneelse, but still writable>\n");
39 printf("Starting tests on %s.\n", pn
);
40 code
= chmod(pn
, 0444);
42 perror("chmod to RO");
45 code
= chmod(pn
, 0666);
47 perror("chmod back to RW");
50 gettimeofday(&tv
[0], NULL
);
51 gettimeofday(&tv
[1], NULL
);
52 tv
[0].tv_sec
-= 10000;
54 tv
[1].tv_sec
-= 20000;
56 code
= utimes(pn
, tv
);
61 code
= stat(pn
, &tstat
);
66 if (tstat
.st_mtime
!= tv
[1].tv_sec
) {
67 printf("modtime didn't stick\n");