Changeset 26 for trunk/forca.c


Ignore:
Timestamp:
Apr 18, 2014, 8:10:14 AM (10 years ago)
Author:
Mattia Monga
Message:

Programmi 2014

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forca.c

    r2 r26  
    66  int x = fork();
    77  if (x < 0){
    8       perror("Errore nella fork:");
    9       exit(1);
    10   } else {
    11     if (x != 0){
    12       while(1) printf("Processo padre (Figlio: %d)\n", x);
    13     } else {
    14       while(1) printf("Processo figlio (%d)\n", x);
    15     }
     8    perror("Errore nella fork:");
     9    exit(1);
     10  }
     11  if (x != 0){
     12    while(1) printf("Processo padre (x == %d)\n", x);
     13 
     14  else { // x == 0
     15   while(1) printf("Processo figlio (x == %d)\n", x);       
    1616  }
    1717  return 0;
    1818}
    19 
    20    
    21        
    22  
Note: See TracChangeset for help on using the changeset viewer.