etc/services - sync with NetBSD-8
[minix.git] / tests / fs / puffs / t_io.c
blob37c386c83d5ab6062faa52f67f7f2ce25e8e3d38
1 /* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */
3 #include <sys/types.h>
4 #include <sys/mount.h>
5 #include <sys/socket.h>
7 #include <assert.h>
8 #include <atf-c.h>
9 #include <err.h>
10 #include <errno.h>
11 #include <fcntl.h>
12 #include <pthread.h>
13 #include <puffs.h>
14 #include <puffsdump.h>
15 #include <stdio.h>
16 #include <unistd.h>
17 #include <string.h>
18 #include <stdlib.h>
20 #include <rump/rump.h>
21 #include <rump/rump_syscalls.h>
23 #include "../../h_macros.h"
24 #include "../common/h_fsmacros.h"
26 #define MAKEOPTS(...) \
27 char *theopts[] = {NULL, "-s", __VA_ARGS__, "dtfs", "n/a", NULL}
29 ATF_TC(nocache);
30 ATF_TC_HEAD(nocache, tc)
33 atf_tc_set_md_var(tc, "descr", "tests large i/o without page cache");
36 ATF_TC_BODY(nocache, tc)
38 MAKEOPTS("-o", "nopagecache");
39 char data[1024*1024];
40 void *args;
41 int fd;
43 FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
44 FSTEST_ENTER();
46 RL(fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0755));
47 RL(rump_sys_write(fd, data, sizeof(data)));
48 rump_sys_close(fd);
50 FSTEST_EXIT();
51 FSTEST_DESTRUCTOR(tc, puffs, args);
55 ATF_TP_ADD_TCS(tp)
58 ATF_TP_ADD_TC(tp, nocache);
60 return atf_no_error();