SHARE
TWEET

Ex4

a guest Oct 22nd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int rec(int process, int avancement, int argc){
  2.     if (avancement == argc) return argc;
  3.    
  4.     if (process < MAXFILS) {
  5.         if (fork() == 0){
  6.             avancement = rec(process+1, avancement, argc);
  7.             if (avancement == argc) return argc;
  8.             else{
  9.                 execl("/bin/grep","grep",argv[1],argv[avancement],NULL);
  10.                 return avancement+1;
  11.             }
  12.         }
  13.        
  14.        
  15.        
  16.        
  17.     }
  18.    
  19.     else return avancement;
  20.    
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top