aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_cons.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-10-20 18:31:36 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-10-20 18:31:36 +0000
commit6858c2cc8f2ac2b04f096efa38e202492921de47 (patch)
tree73cc0aee5c4a8ffdbcbbe7fba748454b39461b37 /sys/kern/kern_cons.c
parentc9d10e27863717dcd5e4e1778a8163b5d205b3c0 (diff)
downloadsrc-6858c2cc8f2ac2b04f096efa38e202492921de47.tar.gz
src-6858c2cc8f2ac2b04f096efa38e202492921de47.zip
Replace ttyprintf with sbuf_printf and tty drain routine
Add string variants of cnputc and tty_putchar, and use them from the tty sbuf drain routine. Suggested by: ed@ Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=339468
Diffstat (limited to 'sys/kern/kern_cons.c')
-rw-r--r--sys/kern/kern_cons.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
index 4e2d4c6acbee..8c252af59bc0 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -522,9 +522,9 @@ cnputc(int c)
}
void
-cnputs(char *p)
+cnputsn(const char *p, size_t n)
{
- int c;
+ size_t i;
int unlock_reqd = 0;
if (use_cnputs_mtx) {
@@ -539,13 +539,19 @@ cnputs(char *p)
unlock_reqd = 1;
}
- while ((c = *p++) != '\0')
- cnputc(c);
+ for (i = 0; i < n; i++)
+ cnputc(p[i]);
if (unlock_reqd)
mtx_unlock_spin(&cnputs_mtx);
}
+void
+cnputs(char *p)
+{
+ cnputsn(p, strlen(p));
+}
+
static int consmsgbuf_size = 8192;
SYSCTL_INT(_kern, OID_AUTO, consmsgbuf_size, CTLFLAG_RW, &consmsgbuf_size, 0,
"Console tty buffer size");