MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ttydisc_read

Function ttydisc_read

freebsd/kern/tty_ttydisc.c:325–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325int
326ttydisc_read(struct tty *tp, struct uio *uio, int ioflag)
327{
328 int error;
329
330 tty_assert_locked(tp);
331
332 if (uio->uio_resid == 0)
333 return (0);
334
335 if (CMP_FLAG(l, ICANON))
336 error = ttydisc_read_canonical(tp, uio, ioflag);
337 else if (tp->t_termios.c_cc[VTIME] == 0)
338 error = ttydisc_read_raw_no_timer(tp, uio, ioflag);
339 else if (tp->t_termios.c_cc[VMIN] == 0)
340 error = ttydisc_read_raw_read_timer(tp, uio, ioflag,
341 uio->uio_resid);
342 else
343 error = ttydisc_read_raw_interbyte_timer(tp, uio, ioflag);
344
345 if (ttyinq_bytesleft(&tp->t_inq) >= tp->t_inlow ||
346 ttyinq_bytescanonicalized(&tp->t_inq) == 0) {
347 /* Unset the input watermark when we've got enough space. */
348 tty_hiwat_in_unblock(tp);
349 }
350
351 return (error);
352}
353
354static __inline unsigned int
355ttydisc_findchar(const char *obstart, unsigned int oblen)

Callers 1

ttydev_readFunction · 0.85

Calls 7

ttydisc_read_canonicalFunction · 0.85
ttyinq_bytesleftFunction · 0.85
tty_hiwat_in_unblockFunction · 0.85

Tested by

no test coverage detected