xref: /titanic_50/usr/src/man/man9f/dupmsg.9f (revision 7b07063d906859b2be1e88791f801b3c96e432f6)
te
Copyright 1989 AT&T
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
DUPMSG 9F "Apr 11, 1991"
NAME
dupmsg - duplicate a message
SYNOPSIS

#include <sys/stream.h>



mblk_t *dupmsg(mblk_t *mp);
INTERFACE LEVEL

Architecture independent level 1 (DDI/DKI).

PARAMETERS
mp

Pointer to the message.

DESCRIPTION

dupmsg() forms a new message by copying the message block descriptors pointed to by mp and linking them. dupb(9F) is called for each message block. The data blocks themselves are not duplicated.

RETURN VALUES

If successful, dupmsg() returns a pointer to the new message block. Otherwise, it returns a NULL pointer. A return value of NULL indicates either memory depletion or the data block reference count, db_ref (see datab(9S)), has reached a limit (255). See dupb(9F).

CONTEXT

dupmsg() can be called from user, kernel, or interrupt context.

EXAMPLES

Example 1 Using dupmsg()

See copyb(9F) for an example using dupmsg().

SEE ALSO

copyb(9F), copymsg(9F), dupb(9F), datab(9S)

Writing Device Drivers

STREAMS Programming Guide