From 80ae8fe82cdaa69f78dc90fa27bc9e79863de0ea Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 21 Feb 2012 01:05:12 +0000 Subject: Fix found places where uio_resid is truncated to int. Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from the usermode. Discussed with: bde, das (previous versions) MFC after: 1 month --- sys/kern/tty_ttydisc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/kern/tty_ttydisc.c') diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index 1ac204b..6d36de4 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -180,7 +180,7 @@ static int ttydisc_read_raw_no_timer(struct tty *tp, struct uio *uio, int ioflag) { size_t vmin = tp->t_termios.c_cc[VMIN]; - int oresid = uio->uio_resid; + ssize_t oresid = uio->uio_resid; int error; MPASS(tp->t_termios.c_cc[VTIME] == 0); @@ -265,7 +265,7 @@ static int ttydisc_read_raw_interbyte_timer(struct tty *tp, struct uio *uio, int ioflag) { size_t vmin = tp->t_termios.c_cc[VMIN]; - int oresid = uio->uio_resid; + ssize_t oresid = uio->uio_resid; int error; MPASS(tp->t_termios.c_cc[VMIN] != 0); @@ -1173,7 +1173,7 @@ int ttydisc_getc_uio(struct tty *tp, struct uio *uio) { int error = 0; - int obytes = uio->uio_resid; + ssize_t obytes = uio->uio_resid; size_t len; char buf[TTY_STACKBUF]; -- cgit v1.1