[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

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

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.

Related Information

The getcf kernel service.

I/O Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]