File:  [ELWIX - Embedded LightWeight unIX -] / libaitio / example / test_exec.c
Revision 1.1.2.4: download - view: text, annotated - select for diffs - revision graph
Thu Dec 5 16:02:02 2013 UTC (10 years, 7 months ago) by misho
Branches: io6_7
...

    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: end:
   34: 	io_progDestroy(&p);
   35: 	return ret;
   36: }

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