custom message for vm_update
[minix3.git] / test / t68a.c
blobd39835856fcca6ef88a6f851c6eba6f267a1b661
1 #include <sys/types.h>
2 #include <sys/wait.h>
3 #include <fcntl.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <unistd.h>
8 int
9 main(int argc, char *argv[])
11 int fd, fd_parent;
12 char buf[1];
14 if (argc != 2) {
15 return 1;
18 fd_parent = atoi(argv[1]);
20 /* If we open a new file, the fd we obtain should be fd_parent + 1 */
21 fd = open("open_plusplus_fd", O_CREAT|O_RDWR, 0660);
22 if (fd != fd_parent + 1) {
23 return 2;
26 /* Also, writing to fd_parent should succeed */
27 if (write(fd_parent, buf, sizeof(buf)) <= 0) {
28 return 3;
31 return 0;