Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

6.13.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 null 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.