06.07.2023 13:54, stsp пишет:
06.07.2023 13:41, Murphy Zhou пишет:
+ semid = semget(semkey, 2, IPC_CREAT);
if (semctl(semid, 2, IPC_RMID, semu)
== -1)
Good catch. This RMID is useless unless we have got the existing
semaphore. According to SEMGET(2), seems should be:
semid = semget(semkey, 2, 0);
to obtain an existing semaphore?
Yes, I just wanted to avoid the purely
theoretical condition when someone
else removed this sem right before we
did second semget(). So I added IPC_CREAT
just as a safety measure.
Should I remove it?
Ping!
So how should I proceed with the patch?
Who can give reviewed-by?