Changeset 7ec935e in rtems-libbsd for libbsd.txt


Ignore:
Timestamp:
Mar 23, 2018, 6:58:18 AM (15 months ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
7ece7548c1b05cf6bb10e6708b83b2401d45c250, 29cc431e0bcfe059d65ac3019f53eeafa5064ae8
Children:
8993827
Parents:
d300a34
git-author:
Christian Mauderer <christian.mauderer@…> (03/23/18 06:58:18)
git-committer:
Christian Mauderer <christian.mauderer@…> (03/23/18 08:36:35)
Message:

vprintf: Add handler that mutes all output.

This adds a vprintf handler that can be used to suppress all outputs of
the libbsd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libbsd.txt

    rd300a34 r7ec935e  
    265265function (for example in the module which calls `rtems_bsd_initialize()`) if
    266266different values are desired.  The default size is 8MiB for all domains.
     267
     268=== Redirecting or Disabling the Output ===
     269
     270A lot of system messages are printed to the stdout by default. If you want to
     271redirect them you can overwrite the default print handler. That can even be done
     272before the libbsd initialization to catch all messages. An example would look
     273like follows:
     274
     275-------------------------------------------------------------------------------
     276int my_vprintf_handler(int level, const char *fmt, va_list ap) {
     277        /* Do something with the messages. */
     278
     279        return number_of_printed_chars;
     280}
     281
     282...
     283        /* In your initialization: */
     284        rtems_bsd_vprintf_handler old;
     285        old = rtems_bsd_set_vprintf_handler(my_vprintf_handler);
     286...
     287-------------------------------------------------------------------------------
     288
     289As a special case, you can set the `rtems_bsd_vprintf_handler_mute(...)`
     290provided by libbsd to suppress all output.
    267291
    268292== Network Stack Features
Note: See TracChangeset for help on using the changeset viewer.