1: #include <stdio.h>
2: #include <aitio.h>
3: #include <sys/wait.h>
4:
5:
6: int
7: main(int argc, char **argv)
8: {
9: prog_t *p;
10: int ret = 0;
11:
12: if (argc < 2)
13: return 1;
14:
15: p = io_progInit(argv[1], 3, 10);
16: if (!p) {
17: ELIBERR(io);
18: return 2;
19: } else if ((ret = io_progCheck(p))) {
20: printf("0.exited procs=%d\n", ret);
21: goto end;
22: } else {
23: printf("wait for keystroke %p ", p);
24: getchar();
25: }
26:
27: ret = io_progCheck(p);
28: if (ret) {
29: printf("1.exited procs=%d\n", ret);
30: goto end;
31: }
32:
33: printf("last=%d\n", array_Last(p->prog_fds));
34:
35: ret = io_progGrow(p, 8);
36: printf("+grow_progs=%d\n", ret);
37:
38: printf("wait for keystroke %p ", p);
39: getchar();
40:
41: ret = io_progVacuum(p, 5);
42: printf("+vacuum_progs=%d\n", ret);
43:
44: printf("wait for keystroke %p ", p);
45: getchar();
46: end:
47: io_progDestroy(&p);
48: return ret;
49: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>