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