getcb Kernel Service

Purpose

Removes the first buffer from a character list and returns the address of the removed buffer.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <cblock.h>

struct cblock *getcb
(
header)
struct clist *header;

Parameter

Item Description
header Specifies the address of the clist structure that describes the character list.

Description

Attention: The caller of the getcb service must ensure that the character list is pinned. This includes the clist header and all the cblock character buffers. Character buffers acquired from the getcf service are pinned. Otherwise, the system may crash.

The getcb kernel service returns the address of the character buffer at the start of the character list and removes that buffer from the character list. The user must free the buffer with the putcf service when finished with it.

Execution Environment

The getcb kernel service can be called from either the process or interrupt environment.

Return Values

A null address indicates the character list is empty.

The getcb service returns the address of the character buffer at the start of the character list when the character list is not empty.