#include #include #include #include void monitorselect(int fd[], int numfds); void docommand(char *buf, int num) { fprintf(stderr,"Got command !%.*s!\n",num,buf); } int main(int argc, char *argv[]){ int *fds; int i; if (argc <= 1) { fprintf(stderr,"Usage: %s pipe1 pipe2 ...\n",argv[0]); return 1; } fds = (int *)malloc((argc-1)*sizeof(int)); if (fds == NULL) { fprintf(stderr,"Malloc error\n"); return 1; } for (i=0;i