00001 #include <wvstreamlist.h> 00002 #include <wvpipe.h> 00003 00004 int main() 00005 { 00006 const char *argv1[] = { "sh", "-c", 00007 "while :; do echo foo; sleep 3; done" }; 00008 const char *argv2[] = { "sh", "-c", 00009 "while :; do echo snorkle; sleep 1; done" }; 00010 00011 WvPipe stream1(argv1[0], argv1, false, true, false); 00012 WvPipe stream2(argv2[0], argv2, false, true, false); 00013 stream1.autoforward(*wvcon); 00014 stream2.autoforward(*wvcon); 00015 00016 WvStreamList l; 00017 l.append(&stream1, false); 00018 l.append(&stream2, false); 00019 00020 while (stream1.isok() || stream2.isok()) 00021 { 00022 if (l.select(-1)) 00023 l.callback(); 00024 } 00025 }