vuoi
o PayPal
tutte le volte che vuoi
semctl
semctl pointed to by arg.array, where arg is the fourth argument to semctl(). When this command is successfully executed, the semadj values corresponding to each specified semaphore in all processes are cleared. Requires alter permission.
The following values of cmd are also available:
- IPC_STAT: Place the current value of each member of the data structure associated with semid_ds semid into the structure pointed to by arg.buf, where arg is the fourth argument to semctl(). The contents of this structure are defined in <sys/sem.h>. Requires read permission.
- IPC_SET: Set the value of the following members of the data structure associated with semid_ds semid to the corresponding value found in the structure pointed to by arg.buf, where arg is the fourth argument to semctl(): sem_perm.uid sem_perm.gid sem_perm.mode The mode bits specified in IPC are copied into the corresponding bits of the associated with semid. The stored values of any other
bits aresem_perm.modeunspecified. This command can only be executed by a process that has an effectiveuser ID equal to either that of a process with appropriate privileges or to the value ofor in the data structure associated withsem_perm.cuid sem_perm.uid semid_dssemid.
IPC_RMIDRemove the semaphore-identifier specified by semid from the system and destroy theset of semaphores and data structure associated with it. This command cansemid_dsonly be executed by a process that has an effective user ID equal to either that of aprocess with appropriate privileges or to the value of orsem_perm.cuidin the data structure associated with semid.sem_perm.uid semid_ds
RETURN VALUEIf successful, the value returned by semctl() depends on cmd as follows:
- GETVALThe value of semval.
- GETPIDThe value of sempid.
- GETNCNTThe value of semncnt.
- GETZCNTThe value of semzcnt.
- All others0.
Otherwise, semctl() returns -1 and errno indicates the error.
ERRORSThe semctl() function will fail if:
- 2 di 3 21/04/2010 14:14