The remaining stubs are provided in Listing 15.3. The read and write operations utilize the putc and getc interface described in Chapter 5; in both cases we restrict our transfers to a single character. Notice that most of the remaining stubs simply return an error code; an exception is _isatty which returns 1 since we’re using the uart as a terminal. _fstat which provides meta data for open files always sets the file mode to S_IFCHR which denotes
a character oriented device.