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

Item Description
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

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