#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <aitio.h>
int
main(int argc, char **argv)
{
int f, ret;
char buf[BUFSIZ];
f = open("test_aio.dat", O_CREAT | O_RDWR | O_TRUNC, 0644);
if (f == -1) {
perror("open");
return 1;
}
while (!feof(stdin)) {
memset(buf, 0, sizeof buf);
fgets(buf, sizeof buf, stdin);
printf("io_write=%d\n", (ret = io_write(f, buf, strlen(buf))));
if (ret == -1) {
ioLIBERR(io);
return 2;
}
}
close(f);
return 0;
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>