Anteprima
Vedrai una selezione di 1 pagina su 3
Sistemi operativi - Syscall msgsnd 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

msgsnd - message send operation

The Single UNIX ® Specification, Version 2

Copyright © 1997 The Open Group

The msgsnd() function is used to send a message to the queue associated with the messagequeue identifier specified by msqid.

The argument msgp points to a user-defined buffer that must contain first a field of type longthat will specify the type of the message, and then a data portion that will hold the dataintbytes of the message. The structure below is an example of what this user-defined buffermight look like:

struct mymsg {
    long int mtype; /* message type */
    char mtext[1]; /* message text */
}

The structure member is a non-zero positive type that can be used by themtype long intreceiving process for message selection.

The structure member is any text of length msgsz bytes. The argument msgsz can

rangemtextfrom 0 to a system-imposed maximum.
The argument msgflg specifies the action to be taken if one or more of the following are true:
The number of bytes already on the queue is equal to <sys/msg.h>.msg_qbytes,
The total number of messages on all queues system-wide is equal to the system-imposed limit.

These actions are as follows:
If (msgflg & IPC_NOWAIT) is non-zero, the message will not be sent and the calling thread will return immediately.
If (msgflg & IPC_NOWAIT) is 0, the calling thread will suspend execution until one of the following occurs:
The condition responsible for the suspension no longer exists, in which case the message is sent.
The message queue identifier msqid is removed from the system; when this
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.