- Set a default PCM volume so that something can be heard when driver is
[AROS.git] / test / clib / chown.c
blobc3c4c12587909b4aedf25aea51f6a8bceb61c295
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", buf.st_uid, buf.st_gid);
21 TEST((chown(testfilename, 1000, 1001) != -1));
22 TEST((stat(testfilename, &buf) != -1));
23 printf("owner %d group %d\n", buf.st_uid, buf.st_gid);
25 TEST((chown(testfilename, 1001, 1000) != -1));
26 TEST((stat(testfilename, &buf) != -1));
27 printf("owner %d group %d\n", buf.st_uid, buf.st_gid);
29 cleanup();
30 return OK;
33 void cleanup()
35 remove(testfilename);