source: rtems/cpukit/libcsupport/src/vprintk.c @ 1082798

Last change on this file since 1082798 was 1082798, checked in by Sebastian Huber <sebastian.huber@…>, on Oct 23, 2017 at 11:30:44 AM

score: Add _IO_Printf() and _IO_Vprintf()

The previous vprintk() implementation had a questionable licence header,
lacks support for the 'z' and 'j' format specifiers, is not robust
against invalid format specifiers, uses a global variable for output.
Replace it with a stripped down version of the FreeBSD kernel kvprintf()
function.

The new implementation allows a low overhead rtems_snprintf() if
necessary.

Update #3199.
Close #3216.

  • Property mode set to 100644
File size: 702 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Print Formatted Output
5 *  @ingroup libcsupport
6 */
7
8/*
9 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
10 *
11 *  embedded brains GmbH
12 *  Dornierstr. 4
13 *  82178 Puchheim
14 *  Germany
15 *  <rtems@embedded-brains.de>
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#if HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <rtems/bspIo.h>
27#include <rtems/score/io.h>
28
29static void vprintk_putchar( int c, void *arg )
30{
31  rtems_putc((char) c);
32}
33
34int vprintk( const char *fmt, va_list ap )
35{
36  return _IO_Vprintf( vprintk_putchar, NULL, fmt, ap );
37}
Note: See TracBrowser for help on using the repository browser.