Shmget: argument non Valide. Pourquoi j'ai cette erreur?

Je reçois un "shmget: argument non Valide erreur" alors que j'essaie d'exécuter cette partie de code

  int *nFS, *spb, *cell1, shmid;
  key_t key = 5768; 

  //i need a shared memory segment in which i can put 3 ints
  if ((shmid = shmget(key, (sizeof(int) * 3), IPC_CREAT | 0666)) < 0 ) {
             perror("shmget");
             exit(1);
       } 
 if ((spb = (int)shmat(shmid, NULL, 0))== -1 ){  
            perror("shmat");
            exit(1);
      }
  cell1= spb + 1 ;
  nFS= cell1 + 1;
  //i try to assign here 7 to  nFS
  *nFS=7;

il ya quelque chose de mal ici, mais je ne peux pas comprendre ce que. Pouvez-vous m'aider?

Merci, Alex.

quelqu'un qui a un problème comme le tien, cboard
Vous êtes en demander trop peu!

OriginalL'auteur Sicioldr | 2011-12-08