Add sun4i ram controller definitions
[AROS.git] / test / clib / chown.c
blob78b2f9f36fb4f1c18d8158c877fd4d339859b205
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <sys/stat.h>
7 #include <sys/types.h>
8 #include <unistd.h>
9 #include <fcntl.h>
10 #include <stdio.h>
11 #include "test.h"
13 char testfilename[] = "__TEST__";
15 int main()
17 struct stat buf;
18 int fd;
19 fd = creat(testfilename, 0700);
20 TEST((fd != -1));
21 close(fd);
23 TEST((stat(testfilename, &buf) != -1));
24 printf("owner %d group %d\n", (int)buf.st_uid, (int)buf.st_gid);
26 TEST((chown(testfilename, 1000, 1001) != -1));
27 TEST((stat(testfilename, &buf) != -1));
28 printf("owner %d group %d\n", (int)buf.st_uid, (int)buf.st_gid);
30 TEST((chown(testfilename, 1001, 1000) != -1));
31 TEST((stat(testfilename, &buf) != -1));
32 printf("owner %d group %d\n", (int)buf.st_uid, (int)buf.st_gid);
34 cleanup();
35 return OK;
38 void cleanup()
40 remove(testfilename);