diff options
author | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2018-03-23 07:58:18 +0100 |
---|---|---|
committer | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2018-03-23 09:36:35 +0100 |
commit | 7ec935e03f13baa899ab62f5c8348eec5ca35e5c (patch) | |
tree | 8f1456d7945b75f0d514162eb904df7f71903516 /libbsd.txt | |
parent | Silence rtems_bsd_ifconfig() (diff) | |
download | rtems-libbsd-7ec935e03f13baa899ab62f5c8348eec5ca35e5c.tar.bz2 |
vprintf: Add handler that mutes all output.
This adds a vprintf handler that can be used to suppress all outputs of
the libbsd.
Diffstat (limited to 'libbsd.txt')
-rw-r--r-- | libbsd.txt | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -265,6 +265,30 @@ their own implementation of the `rtems_bsd_get_allocator_domain_size()` function (for example in the module which calls `rtems_bsd_initialize()`) if different values are desired. The default size is 8MiB for all domains. +=== Redirecting or Disabling the Output === + +A lot of system messages are printed to the stdout by default. If you want to +redirect them you can overwrite the default print handler. That can even be done +before the libbsd initialization to catch all messages. An example would look +like follows: + +------------------------------------------------------------------------------- +int my_vprintf_handler(int level, const char *fmt, va_list ap) { + /* Do something with the messages. */ + + return number_of_printed_chars; +} + +... + /* In your initialization: */ + rtems_bsd_vprintf_handler old; + old = rtems_bsd_set_vprintf_handler(my_vprintf_handler); +... +------------------------------------------------------------------------------- + +As a special case, you can set the `rtems_bsd_vprintf_handler_mute(...)` +provided by libbsd to suppress all output. + == Network Stack Features http://roy.marples.name/projects/dhcpcd/index[DHCPCD(8)]:: DHCP client |