errno must be accessed by a macro from errno.h. Tidy includes and add unistd.h for read/write. Consolidate patches for easy of maintenance. This code is borderline useless and certainly broken with modern tape sizes due to the use of ints for sizes. PR: 281781 Approved by: sjroz@verizon.net (maintainer)