Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ unlinkb(9F) — SunOS 5.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

linkb(9F)

unlinkb(9F)

NAME

unlinkb − remove a message block from the head of a message

SYNOPSIS

#include <sys/stream.h>
mblk_t ∗unlinkb(mblk_t ∗mp);

ARGUMENTS

mp Pointer to the message. 

INTERFACE LEVEL

Architecture independent level 1 (DDI/DKI). 

DESCRIPTION

unlinkb() removes the first message block from the message pointed to by mp. A new message, minus the removed message block, is returned.

RETURN VALUES

If successful, unlinkb() returns a pointer to the message with the first message block removed.  If there is only one message block in the message, NULL is returned. 

CONTEXT

unlinkb() can be called from user or interrupt context. 

EXAMPLE

The routine expects to get passed an M_PROTO T_DATA_IND message.  It will remove and free the M_PROTO header and return the remaining M_DATA portion of the message. 

 1  mblk_t ∗
 2  makedata(mp)
 3      mblk_t ∗mp;
 4  {
 5mblk_t ∗nmp;
 6
 7nmp = unlinkb(mp);
 8freeb(mp);
 9return(nmp);
10  }

SEE ALSO

linkb(9F)

SunOS 5.1 Writing Device Drivers
SunOS 5.1 STREAMS Programmer’s Guide

SunOS 5.2  —  Last change: 11 Apr 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026