![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fork() problem | ddx08 | High Level Programming | 3 | 03-01-2007 06:06 AM |
| Error Checking Problem | pokeycam | Shell Programming and Scripting | 4 | 09-13-2006 12:38 AM |
| fork problem | qntmteleporter | High Level Programming | 4 | 01-25-2006 03:56 AM |
| link error problem | niukun | Linux | 4 | 11-18-2004 01:14 AM |
| fork error | santoshsonawane | UNIX for Dummies Questions & Answers | 1 | 08-17-2002 06:59 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
It's simple enough.
Code:
#define MAXC 25
pid_t do_child(char *cmd, char *args[]);
int main(void) {
int v = 0, x =0;
pid_t p_arrays[MAXC];
while (v < MAXC) {p_arrays[v] = do_child(...); v++);
while (x < (MAXC - 1)) {
if (waitpid(0,NULL,WNOHANG)) > 0) {x++;}
sleep(1);
}
}
/*do_child with fork + execv is simple as is parsing and passing args to do_child in main*/
|
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Sorry for the delay
And thanks all for your replies.. I really helped.. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|