Anteprima
Vedrai una selezione di 1 pagina su 3
Sistemi operativi - Syscall semop Pag. 1
1 su 3
D/illustrazione/soddisfatti o rimborsati
Disdici quando
vuoi
Acquista con carta
o PayPal
Scarica i documenti
tutte le volte che vuoi
Estratto del documento

semop - semaphore operations

The semop() function is used to perform atomically a user-defined array of semaphore operations on the set of semaphores associated with the semaphore identifier specified by the argument semid.

The argument sops is a pointer to a user-defined array of semaphore operation structures. The implementation will not modify elements of this array unless the application uses implementation-dependent extensions.

The argument nsops is the number of such structures in the array.

Each structure includes the following members:

  • sem_num: semaphore number
  • sem_op: semaphore operation
  • sem_flg: operation flags

Each semaphore operation specified by sem_op is performed on the semaphores.

The corresponding semaphore specified by semid and sem_num. The variable sem_op specifies one of three semaphore operations:

  1. If sem_op is a negative integer and the calling process has alter permission, one of the following will occur: <sys/sem.h>, is greater than or equal to the absolute value of If semval, seesem_op, the absolute value of sem_op is subtracted from semval. Also, if(sem_flg&SEM_UNDO) is non-zero, the absolute value of sem_op is added to the calling process' semadj value for the specified semaphore.
  2. If semval is less than the absolute value of sem_op and(sem_flg&IPC_NOWAIT) is non-zero, semop() will return immediately.
  3. If semval is less than the absolute value of sem_op and(sem_flg&IPC_NOWAIT) is 0, semop() will increment the semncnt associated with the specified semaphore and suspend execution of the calling thread until one of the following conditions occurs:
Dettagli
Publisher
A.A. 2012-2013
3 pagine
SSD Scienze matematiche e informatiche INF/01 Informatica

I contenuti di questa pagina costituiscono rielaborazioni personali del Publisher N. A. di informazioni apprese con la frequenza delle lezioni di Sistemi operativi e studio autonomo di eventuali libri di riferimento in preparazione dell'esame finale o della tesi. Non devono intendersi come materiale ufficiale dell'università Università degli studi di Napoli Federico II o del prof Cotroneo Domenico.