Tests/Partition: Compiler delinit
[AROS.git] / test / clib / chown.c
blob0dd16162adafd7f3ecc9b496bb272ed1ccfd227f
1 #include <sys/stat.h>
2 #include <sys/types.h>
3 #include <unistd.h>
4 #include <fcntl.h>
5 #include <stdio.h>
6 #include "test.h"
8 char testfilename[] = "__TEST__";
10 int main()
12 struct stat buf;
13 int fd;
14 fd = creat(testfilename, 0700);
15 TEST((fd != -1));
16 close(fd);
18 TEST((stat(testfilename, &buf) != -1));
19 printf("owner %d group %d\n", (int)buf.st_uid, (int)buf.st_gid);
21 TEST((chown(testfilename, 1000, 1001) != -1));
22 TEST((stat(testfilename, &buf) != -1));
23 printf("owner %d group %d\n", (int)buf.st_uid, (int)buf.st_gid);
25 TEST((chown(testfilename, 1001, 1000) != -1));
26 TEST((stat(testfilename, &buf) != -1));
27 printf("owner %d group %d\n", (int)buf.st_uid, (int)buf.st_gid);
29 cleanup();
30 return OK;
33 void cleanup()
35 remove(testfilename);