Link to home
Start Free TrialLog in
Avatar of dimi67
dimi67Flag for Greece

asked on

using fork(),wait() etc in devcpp

how can I "connect" devcpp with the libraries of linux unistd.h, sys/wai.h etc, in order to run peograms with system calls like fork(),wait(),exec() etc?
Thanks
Avatar of ozo
ozo
Flag of United States of America image

#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>

pid_t p;
p=fork();
if( p==0 ){
  /* child */
}else if( p > 0 ){
  /* parent */
  int status;
  wait(&status);
}else{
   /* error */
}
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial