#include <kernel.h>
#include <device.h>
#include <tty.h>
Go to the source code of this file.
Functions | |
devcall | ttyRead (device *pdev, char *buf, ushort len) |
Definition in file ttyRead.c.
Read characters from a tty.
Characters are read from an underlying device, normally a UART. Input is read from the underlying device in lines. Lines may be terminated with the line feed or carriage return characters. Read requests are not satsified until a full line has been read, or the tty's buffer is full. When the tty is not in raw mode, backspaces are cooked and escape sequences and the null character is ignored. When the end of file (Control+D) character is read, the tty stops reading from the underlying device. Subsquent calls to ttyRead will attempt to staisfy the request from the tty's buffer, otherwise EOF will be returned.
pdev | pointer to tty device | |
buf | buffer for read characters | |
len | size of the buffer |
Definition at line 31 of file ttyRead.c.
References ASSERT, dentry::controlblk, EOF, dentry::getc, tty::icount, tty::iflags, tty::inbuf, tty::istart, NULL, tty::state, SYSERR, tty::tty_dev, TTY_IBLEN, TTY_IFLAG_CBREAK, TTY_IFLAG_ECHO, TTY_IFLAG_EOF, TTY_IFLAG_RAW, tty::tty_phw, TTY_STATE_ALLOC, and ttyPutChar().
Referenced by ttyGetChar().