22 #include "vcon_stream.h" 26 #include <sys/ioctl.h> 27 #include <sys/ttydefaults.h> 29 namespace L4Re {
namespace Core {
31 : Be_file_stream(), _s(s), _irq(L4Re::virt_cap_alloc->alloc<L4::Semaphore>())
45 Vcon_stream::readv(
const struct iovec *iovec,
int iovcnt)
throw()
48 for (; iovcnt > 0; --iovcnt, ++iovec)
50 if (iovec->iov_len == 0)
53 char *buf = (
char *)iovec->iov_base;
54 size_t len = iovec->iov_len;
58 int ret = _s->read(buf, len);
71 ret = _s->read(buf, len);
94 Vcon_stream::writev(
const struct iovec *iovec,
int iovcnt)
throw()
99 Vfs_config::memcpy(&store, mr,
sizeof(store));
104 size_t sl = iovec->iov_len;
105 char const *b = (
char const *)iovec->iov_base;
109 _s->send(b, L4_VCON_WRITE_SIZE);
113 written += iovec->iov_len;
118 Vfs_config::memcpy(mr, &store,
sizeof(store));
123 Vcon_stream::fstat64(
struct stat64 *buf)
const throw()
127 buf->st_dev = _s.cap();
133 Vcon_stream::ioctl(
unsigned long request, va_list args)
throw()
140 struct termios *t = va_arg(args,
struct termios *);
151 t->c_iflag = t->c_oflag = t->c_cflag = t->c_lflag = 0;
154 t->c_lflag |= ICANON;
157 t->c_cc[VEOF] = CEOF;
158 t->c_cc[VEOL] = _POSIX_VDISABLE;
159 t->c_cc[VEOL2] = _POSIX_VDISABLE;
160 t->c_cc[VERASE] = CERASE;
161 t->c_cc[VWERASE]= CWERASE;
162 t->c_cc[VKILL] = CKILL;
163 t->c_cc[VREPRINT]=CREPRINT;
164 t->c_cc[VINTR] = CINTR;
165 t->c_cc[VQUIT] = _POSIX_VDISABLE;
166 t->c_cc[VSUSP] = CSUSP;
167 t->c_cc[VSTART] = CSTART;
168 t->c_cc[VSTOP] = CSTOP;
169 t->c_cc[VLNEXT] = CLNEXT;
170 t->c_cc[VDISCARD]=CDISCARD;
171 t->c_cc[VMIN] = CMIN;
183 struct termios const *t = va_arg(args,
struct termios
const *);
Encapsulation of the message-register block in the UTCB.
Vcon attribute structure.
l4_umword_t o_flags
output flags
l4_msg_regs_t * l4_utcb_mr(void) L4_NOTHROW L4_PURE
Get the message-register block of a UTCB.
Maximum size that can be written with one l4_vcon_write call.
static Env const * env()
Returns the initial environment for the current task.
l4_umword_t l_flags
local flags
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Return error code of a system call return message tag.
Common factory related definitions.
l4_umword_t i_flags
input flags