[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

putc Kernel Service

Purpose

Places a character at the end of a character list.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <cblock.h>
int putc (c, header)
char c;
struct clist *header;

Parameters

c Specifies the character 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 putc 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 also pinned. Otherwise, the system may crash.

The putc kernel service puts the character specified by the c parameter at the end of the character list pointed to by the header parameter.

If the putc service indicates that there are no more buffers available, the waitcfree service can be used to wait until a character block is available.

Execution Environment

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

Return Values

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

Implementation Specifics

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

Related Information

The getcb kernel service, getcf kernel service, pincf kernel service, putcf kernel service, putcfl kernel service, waitcfree kernel service.

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


[ Previous | Next | Contents | Home | Search ]