: union semun arg;
return semctl;};int semAvailable(int semId, int semNum) {
if (semctl之后(semid,0,GETVAL,arg),它打印了正确的值,最后我尝试在主程序中调用initSem()之后调用semctl</e
(sem_id, 0, IPC_STAT, arg) == -1) { exit(2); printfSet arg (the union) to the address of the initializing vector */ if (semctl(sem_id, 0, SETALL, arg) == -1) {
perror("<em
id:%d\n",argv[0],proj_id,semid); semun_buf.buf=&semid_ds_buf; semctlprintf("current number of semaphores:%lu\n",semid_ds_buf.sem_nsems);
if(semctl(semid,0,SEM_INFO,&semun_buf)==-1)