STREAMS-UX Programmer's Guide (February 2007)
STREAMS Utilities Supported by HP-UX
Appendix B
187
NAME
msgpullup () – Concatenates a specified number of bytes from a message into a new message.
SYNOPSIS
#include <sys/stream.h>
mblk_t *msgpullup (mblk_t *mp, int len);
PARAMETERS
mp
Pointer to the message.
len
Number of bytes to be concatenated. If
len
is set to -1, all data bytes are concatenated.
DESCRIPTION
msgpullup concatenates and aligns the first
len
data bytes of the message pointed to by
mp
, copying the data
into a new message. All message blocks that remain in the original message once
len
bytes have been
concatenated and aligned (including any partial message blocks) are copied and linked to the end of the new
message, so that the length of the new message is equal to the length of the original message. The original
message is unaltered.
If
len
equals -1, all data are concatenated. If
len
bytes of the same message type cannot be found,
msgpullup() fails and returns NULL.
RETURN VALUES
Upon success, msgpullup() returns a pointer to the new message. If the number of data bytes in the original
message is less than
len
bytes or if memory allocation failures occur, msgpullup fails and returns NULL.
CONSTRAINTS
msgpullup can be called from thread or interrupt context. Only spinlocks with STREAMS/UX user lock order
can be held across this call.