putcb Kernel Service

Purpose

Places a character buffer at the end of a character list.

Syntax

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

void putcb ( p,  header)
struct cblock *p;
struct clist *header;

Parameters

Item Description
p Specifies the address of the character buffer to place on the character list.
header Specifies the address of the clist structure that describes the character list.

Description

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

The putcb kernel service places the character buffer pointed to by the p parameter on the end of the character list specified by the header parameter. Before calling the putcb service, you must load this new buffer with characters and set the c_first and c_last fields in the cblock structure. The p parameter is the address returned by either the getcf or the getcb service.

Execution Environment

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

Return Values

Item Description
0 Indicates successful completion.
-1 Indicates that the character list is full and no more buffers are available.