DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

getchar(D3oddi)


getchar -- get one character of input during debug

Synopsis

int getchar(void);

Description

The getchar( ) function is used when debugging a driver to temporarily halt execution of the kernel, and get one character of input from a user.

Arguments

None.

Return values

getchar returns the character typed at the keyboard.

Usage

The getchar( ) function returns a single character from the keyboard. The character is automatically echoed. The only other processing done on this character is to map <Return> to <Return>/<Line feed> on output. When you have many lines of cmn_err(D3oddi) output, inserting getchar statements into your driver is one of the better ways to regulate the output flow of messages.

A second use of getchar is to set the level of debugging. For example, you could place two lines of code at the beginning of the open(D2oddi) entry point routine to set the current value of mydebugflg to anywhere between 0 and 9.

   mydebugflg = getchar();
   mydebugflg -= '0';

Context and synchronization

Non-blockable, user or blockable context.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp (Debug only)

SVR5 DDI compatibility

This function is not supported for DDI drivers.

References

calldebug(D3oddi), cmn_err(D3oddi), putchar(D3oddi)

Examples

The following example gets a character (assumed to be numeric) and converts it to the corresponding integer:
   debug = getchar();
   debug -= '0';

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005