putcx Kernel Service

Purpose

Places a character on a character list.

Syntax

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

int putcx ( c,  header)
char c;
struct clist *header;

Parameters

Item Description
c Specifies the character to place at the front of the character list.
header Specifies the address of the clist structure that describes the character list.

Description

The putcx kernel service puts the character specified by the c parameter at the front of the character list pointed to by the header parameter. The putcx service is identical to the putc service, except that it puts the character at the front of the list instead of at the end.

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

Note: The caller of the putcx 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 pinned.

Execution Environment

The putcx 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.