SVR5 and SCO OpenServer 5


msgpullup -- concatenate bytes in a message

Synopsis (not in ODDI)

   #include <sys/stream.h>
   #include <sys/ddi.h>

mblk_t *msgpullup(mblk_t *mp, int len);


msgpullup concatenates and aligns the first len data bytes of the message with the same type as 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.


Pointer to the message whose blocks are to be concatenated.

Number of bytes to concatenate.

Return values

On success, msgpullup returns a pointer to the new message. On failure, msgpullup returns NULL.


msgpullup( ) can only pull up mblk structures with the same type as the first mblk that was passed in, so even when len is set to -1, it is possible that no message blocks are returned.

Drivers should not assume that the memory allocated for the data buffer(s) is usable for DMA operations. nor should drivers assume that the memory has any specific physical properties such as starting address alignment, physical address range, or physical contiguity. Beginning with ddi version 6, memory with specific physical properties can be obtained through msgpullup_physreq(D3str) or msgphysreq(D3str).


Base or Interrupt.

Synchronization constraints

Does not block.

Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.

Hardware applicability


Version applicability

ddi: 3, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

Differences between versions

In DDI versions 1, 2, 3, 4, 5, and 5mp, the memory for the data buffer(s) returned by msgpullup is DMA-able; that is, it satisfies worst-case DMA-ability requirements on systems with restricted DMA and is physically contiguous; see the phys_dmasize member of the physreq(D4) structure. For other versions, there are no guarantees on the memory properties.

SCO OpenServer 5 ODDI compatibility

SCO OpenServer 5 ODDI drivers call the pullupmsg(D3str) function instead of msgpullup( ). Note that pullupmsg( ) and pullupmsg_physreq( ) return a new message, leaving the old one intact, whereas pullupmsg( ) concatenates into the given message. pullupmsg( )


allocb(D3str), msgphysreq(D3str), msgpullup_physreq(D3str), msgb(D4str)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005