Annotation of libaitio/example/test_exec.c, revision 1.1.2.3

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.3 ! misho      10:        int stat;
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;
                     19:        } else {
                     20:                printf("wait for keystroke %p ", p);
                     21:                getchar();
                     22:        }
                     23: 
1.1.2.3 ! misho      24:        printf("%d\n", waitpid(-1, &stat, WNOHANG));
        !            25:        printf("%d\n", waitpid(-1, &stat, WNOHANG));
        !            26:        printf("%d\n", waitpid(-1, &stat, WNOHANG));
        !            27:        printf("%d\n", waitpid(-1, &stat, WNOHANG));
        !            28:        printf("%d\n", waitpid(-1, &stat, WNOHANG));
        !            29: 
1.1.2.2   misho      30:        io_progDestroy(&p);
1.1.2.1   misho      31:        return 0;
                     32: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>