vuoi
o PayPal
tutte le volte che vuoi
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