[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, 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.

Implementation Specifics

The getc kernel service is part of Base Operating System (BOS) Runtime.

Related Information

I/O Kernel Services in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]