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

Technical Reference: Kernel and Subsystems, Volume 1

getc Kernel Service

Purpose

Retrieves a character from a character list.

Syntax

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


int getc ( header)
struct clist *header;

Parameter

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

Description

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

The getc kernel service returns the character at the front of the character list. After returning the last character in the buffer, the getc service frees that buffer.

Execution Environment

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

Return Values

-1 Indicates that the character list is empty.

Related Information

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 ]