[so] [Tema2][Linux]Deschidere semafoare
mihai chiritescu
mihaichiritescu at gmail.com
Sun Apr 19 22:46:47 EEST 2009
Nu merge pe site.
In client am asa:
sem_t *sem[BUCKET_COUNT];
char sem_names[BUCKET_COUNT][20];
for(i=0;i<BUCKET_COUNT;i++){
sprintf(sem_names[i],"/sem%d",i);
}
for(i=0;i<BUCKET_COUNT;i++){
sem[i] = sem_open(sem_names[i], O_RDWR);
if (SEM_FAILED == sem[i]) {
perror("Client:Semafor open() failed:");
exit(-1);
}
}
Mersi,
Chiritescu Paul Mihai
334CC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090419/8ebdb136/attachment-0001.htm>
More information about the so
mailing list