HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

p
putmsg(2) putmsg(2)
RETURN VALUE
putmsg() and putpmsg() return the following values:
0 Successful completion.
-1 Error. errno is set to indicate the error.
ERRORS
On failure, errno may be set to one of the following values:
[EAGAIN] A non-priority message was specified, the
O_NONBLOCK flag is set, and the stream write
queue is full due to internal flow control conditions, or buffers could not be allocated for the
message that was to be created.
[EBADF] fildes is not a valid file descriptor open for writing.
[EINTR] A signal was caught during
putmsg()
or putpmsg().
[EINVAL] An undefined value is specified in flags,orflags is set to
RS_HIPRI or MSG_HIPRI and
no control part is supplied, or the stream or multiplexor referenced by fildes is linked
(directly or indirectly) downstream from a multiplexor, or flags is set to
MSG_HIPRI and
band is non-zero (for putpmsg() only).
[EIO] See [EPIPE].
[ENOSTR] A stream is not associated with fildes.
[ENXIO] A hangup condition was generated downstream for the specified stream.
[EPIPE] The fildes argument refers to a STREAMS-based pipe and the other end of the pipe is
closed. A
SIGPIPE signal is generated for the calling process.
[ERANGE] The size of the data part of the message does not fall within the range specified by the max-
imum and minimum packet sizes of the topmost STREAMS module. This value is also
returned if the control part of the message is larger than the maximum configured size of
the control part of a message, or if the data part of the message is larger than the max-
imum configured size of the data part of a message.
In addition, putmsg() and putpmsg() will fail if the stream head had processed an asynchronous error
before the call. In this case, the value of errno does not reflect the result of
putmsg() or putpmsg()
but reflects the prior error.
SEE ALSO
getmsg(2), poll(2), read(2), write(2), thread_safety(5), streamio(7), <stropts.h>.
HP-UX 11i Version 3: February 2007 2 Hewlett-Packard Company 325