ia64/xen-unstable

view tools/libaio/harness/cases/common-7-8.h @ 10736:2937703f0ed0

Added blktap support. Includes kernel driver (enabled as CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README.
author jchesterfield@dhcp92.uk.xensource.com
date Thu Jul 13 10:13:26 2006 +0100 (2006-07-13)
parents
children
line source
1 /* common-7-8.h
2 */
3 #include "aio_setup.h"
5 #include <unistd.h>
7 #define SIZE 512
9 int test_main(void)
10 {
11 char *buf;
12 int rwfd;
13 int status = 0, res;
14 long long limit;
16 rwfd = open(FILENAME, O_RDWR); assert(rwfd != -1);
17 res = ftruncate(rwfd, 0); assert(res == 0);
18 buf = malloc(SIZE); assert(buf != NULL);
19 memset(buf, 0, SIZE);
21 limit = LIMIT;
23 SET_RLIMIT(limit);
25 status |= attempt_rw(rwfd, buf, SIZE, limit-SIZE, WRITE, SIZE);
26 status |= attempt_rw(rwfd, buf, SIZE, limit-SIZE, READ, SIZE);
28 status |= attempt_rw(rwfd, buf, SIZE, 1+limit-SIZE, WRITE, SIZE-1);
29 status |= attempt_rw(rwfd, buf, SIZE, 1+limit-SIZE, READ, SIZE-1);
31 status |= attempt_rw(rwfd, buf, SIZE, limit, WRITE, -EFBIG);
32 status |= attempt_rw(rwfd, buf, SIZE, limit, READ, 0);
33 status |= attempt_rw(rwfd, buf, 0, limit, WRITE, 0);
35 return status;
36 }