subr_prf.c (ff7b7d9039fa5e67800a0fb40e3556838834d5f4) subr_prf.c (91c3cbfe1fbbbd0e7c85a2fcbf685d437f6e4028)
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 281 unchanged lines hidden (view full) ---

290 free(consbuffer, M_TEMP);
291 return;
292}
293
294int
295printf(const char *fmt, ...)
296{
297 va_list ap;
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 281 unchanged lines hidden (view full) ---

290 free(consbuffer, M_TEMP);
291 return;
292}
293
294int
295printf(const char *fmt, ...)
296{
297 va_list ap;
298 struct putchar_arg pca;
299 int retval;
298 int retval;
300#ifdef PRINTF_BUFR_SIZE
301 char bufr[PRINTF_BUFR_SIZE];
302#endif
303
304 va_start(ap, fmt);
299
300 va_start(ap, fmt);
305 pca.tty = NULL;
306 pca.flags = TOCONS | TOLOG;
307 pca.pri = -1;
308#ifdef PRINTF_BUFR_SIZE
309 pca.p_bufr = bufr;
310 pca.p_next = pca.p_bufr;
311 pca.n_bufr = sizeof(bufr);
312 pca.remain = sizeof(bufr);
313 *pca.p_next = '\0';
314#else
315 /* Don't buffer console output. */
316 pca.p_bufr = NULL;
317#endif
318
319 retval = kvprintf(fmt, putchar, &pca, 10, ap);
301 retval = vprintf(fmt, ap);
320 va_end(ap);
321
302 va_end(ap);
303
322#ifdef PRINTF_BUFR_SIZE
323 /* Write any buffered console output: */
324 if (*pca.p_bufr != '\0')
325 cnputs(pca.p_bufr);
326#endif
327
328 if (!panicstr)
329 msgbuftrigger = 1;
330
331 return (retval);
332}
333
334int
335vprintf(const char *fmt, va_list ap)
336{
337 struct putchar_arg pca;
338 int retval;

--- 720 unchanged lines hidden ---
304 return (retval);
305}
306
307int
308vprintf(const char *fmt, va_list ap)
309{
310 struct putchar_arg pca;
311 int retval;

--- 720 unchanged lines hidden ---