Nios® V Processor Software Developer Handbook

ID 743810
Date 5/26/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.11.4. Use /dev/null

At boot time, standard input, standard output, and standard error are all directed towards the null device, that is, /dev/null. This direction ensures that calls to printf() during driver initialization do nothing and therefore are harmless. After all drivers are installed, these streams are redirected to the channels configured in the HAL. The footprint of the code that performs this redirection is small, but you can eliminate it entirely by selecting none for stdin, stdout, and stderr. This selection assumes that you want to discard all data transmitted on standard out or standard error, and your program never receives input through stdin. You can control the assignment of stdin, stdout, and stderr channels by manipulating BSP settings.