Syntax | #include <stropts.h> int putmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int flags); int putpmsg(int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr, int band, int flags); | |
Description |
The message can contain either a data section, a control section or both. The data and control sections to be sent are distinguished from each other by being written to different buffers (see below). The semantics of the sections is defined via the STREAMS module that receives the message. The fildes is a file descriptor that references an open stream. ctlptr and dataptr each point to an int maxlen; /* Not used */ int len; /* Length of data */ void *buf; /* Pointer to buffer for data */ ctlptr points to the structure that describes the control section to be included in the message (if there is one). The For the data section of a message to be sent, dataptr must not be the same as the null pointer, and the If a control section is specified in The STREAM head guarantees that the control section of a message generated by Other flags are used for Normally,
| |
Return val. | 0 | if successful. |
-1 | if an error occurs. | |
Errors |
| |
|
| A message without priority was specified, the |
|
| fildes is not a valid file descriptor open for writing. |
|
| A signal was caught during the |
|
| ctlptr or dataptr point outside the allocated address space. |
| An undefined value was specified in flags For | |
| No buffer could be allocated for the message to be created because there was not enough STREAMs storage space. | |
| No STREAM belongs to fildes. | |
| A hang-up was generated downstream for the specified stream. | |
EPIPE or | ||
fildes references a STREAM-based pipe and the other end of the pipe is closed. The SIGPIPE signal is generated for the calling process. | ||
| The data section of the message has a size that is not within the range defined by the maximum and minimum packet size of the highest stream module. | |
| ||
Notes | If two processes open a FIFO file, with one writing a high-priority message with | |
See also |
|