22#include "vcon_stream.h"
27#include <sys/ttydefaults.h>
29namespace L4Re {
namespace Core {
32 _s(s), _irq(L4Re::virt_cap_alloc->alloc<L4::Semaphore>()), _irq_bound(
false)
39Vcon_stream::readv(
const struct iovec *iovec,
int iovcnt)
noexcept
43 bool was_bound = __atomic_exchange_n(&_irq_bound,
true, __ATOMIC_SEQ_CST);
50 for (; iovcnt > 0; --iovcnt, ++iovec)
52 if (iovec->iov_len == 0)
55 char *buf = (
char *)iovec->iov_base;
56 size_t len = iovec->iov_len;
60 int ret = _s->read(buf, len);
73 ret = _s->read(buf, len);
96Vcon_stream::writev(
const struct iovec *iovec,
int iovcnt)
noexcept
101 Vfs_config::memcpy(&store, mr,
sizeof(store));
106 size_t sl = iovec->iov_len;
107 char const *b = (
char const *)iovec->iov_base;
115 written += iovec->iov_len;
120 Vfs_config::memcpy(mr, &store,
sizeof(store));
125Vcon_stream::fstat64(
struct stat64 *buf)
const noexcept
129 buf->st_dev = _s.cap();
135Vcon_stream::ioctl(
unsigned long request, va_list args)
noexcept
142 struct termios *t = va_arg(args,
struct termios *);
153 t->c_iflag = t->c_oflag = t->c_cflag = t->c_lflag = 0;
156 t->c_lflag |= ICANON;
159 t->c_cc[VEOF] = CEOF;
160 t->c_cc[VEOL] = _POSIX_VDISABLE;
161 t->c_cc[VEOL2] = _POSIX_VDISABLE;
162 t->c_cc[VERASE] = CERASE;
163 t->c_cc[VWERASE]= CWERASE;
164 t->c_cc[VKILL] = CKILL;
165 t->c_cc[VREPRINT]=CREPRINT;
166 t->c_cc[VINTR] = CINTR;
167 t->c_cc[VQUIT] = _POSIX_VDISABLE;
168 t->c_cc[VSUSP] = CSUSP;
169 t->c_cc[VSTART] = CSTART;
170 t->c_cc[VSTOP] = CSTOP;
171 t->c_cc[VLNEXT] = CLNEXT;
172 t->c_cc[VDISCARD]=CDISCARD;
173 t->c_cc[VMIN] = CMIN;
185 struct termios const *t = va_arg(args,
struct termios
const *);
static Env const * env() noexcept
Returns the initial environment for the current task.
C++ interface for capabilities.
Common factory related definitions.
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
l4_msg_regs_t * l4_utcb_mr(void) L4_NOTHROW L4_PURE
Get the message-register block of a UTCB.
@ L4_VCON_WRITE_SIZE
Maximum size that can be written with one l4_vcon_write call.
Vcon attribute structure.
l4_umword_t i_flags
input flags
l4_umword_t o_flags
output flags
l4_umword_t l_flags
local flags
Encapsulation of the message-register block in the UTCB.