mexchange - Exchange one message for another
#include <sys/stream.h> #include <sys/strsun.h> mblk_t *mexchange(queue_t *wq, mblk_t *mp, size_t size, uchar_t type, int32_t primtype);
Solaris DDI specific (Solaris DDI).
wq
mp
size
type
primtype
The mexchange() function exchanges the passed in message for another message of the specified size and type.
If mp is not NULL, is of at least size bytes, and has only one reference (see dupmsg(9F)), mp is converted to be of the specified size and type. Otherwise, a new message of the specified size and type is allocated. If allocation fails, and wq is not NULL, merror(9F) attempts to send an error to the stream head.
Finally, if primtype is not -1 and size is at least 4 bytes, the first 4 bytes are assigned to be primtype. This is chiefly useful for STREAMS-based protocols such as DLPI and TPI which store the protocol message type in the first 4 bytes of each message.
A pointer to the requested message is returned on success. NULL is returned on failure.
This function can be called from user, kernel or interrupt context.
STREAMS Programming Guide
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |