The current libstdc++ basic_file_stdio.cc code assumes a POSIX API underneath the stdio implementation provided by the host libc. This means that the host must provide a fairly broad POSIX file API, including read, write, open, close, lseek and ioctl.
This patch changes basic_file_stdio.cc to only use basic ANSI-C stdio functions, allowing it to be used with libc implementations like picolibc which may not have a POSIX operating system underneath. This is version 2 of the patch. This version uses the existing --enable-stdio option, extending that to add 'stdio_pure' for this mode using a patch created by Jonathan Wakely <jwak...@redhat.com>