HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
p
putmsg(2) putmsg(2)
MULTITHREAD USAGE
The putmsg() and putpmsg() functions are safe to be called by multithreaded applications, and they
are thread-safe for both POSIX Threads and DCE User Threads. The putmsg() and putpmsg() func-
tions have cancellation points. They are async-signal safe and fork-safe. They are not async-cancel safe.
RETURN VALUE
Upon successful completion, putmsg() and putpmsg() return 0. Otherwise, they return -1 and set
errno to indicate the error.
ERRORS
[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).
[ENOSTR] A stream is not associated with fildes.
[ENXIO] A hangup condition was generated downstream for the specified stream.
[EPIPE] or [EIO]
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), <stropts.h>, streamio(7).
Section 2−−242 − 2 − HP-UX Release 11i: December 2000
___
___