diff options
author | Keith Packard <keithp@keithp.com> | 2020-12-15 17:39:24 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-12-15 17:39:24 +0000 |
commit | 75aee072696a711f3e5b3bd1ab1f2b10fef4c7dd (patch) | |
tree | ae30db06f9813e22163964052877a38f044a95b9 /libstdc++-v3/config.h.in | |
parent | 35317db051b9ce3eff7d4ad6d31de026447314f3 (diff) | |
download | gcc-75aee072696a711f3e5b3bd1ab1f2b10fef4c7dd.zip gcc-75aee072696a711f3e5b3bd1ab1f2b10fef4c7dd.tar.gz gcc-75aee072696a711f3e5b3bd1ab1f2b10fef4c7dd.tar.bz2 |
libstdc++: Support libc with stdio-only I/O in libstdc++
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 enabled by a new --enable-cstdio=stdio_pure configure option.
Aided-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_ENABLE_CSTDIO): Allow "stdio_pure"
option and define _GLIBCXX_USE_PURE_STDIO when it is used. Also
add "stdio_posix" option as an alias for "stdio".
* config/io/basic_file_stdio.cc [_GLIBCXX_USE_PURE_STDIO]: Only
use defined stdio entry points for all I/O operations, without
direct calls to underlying POSIX functions.
* config.h.in: Regenerate.
* configure: Regenerate.
Diffstat (limited to 'libstdc++-v3/config.h.in')
-rw-r--r-- | libstdc++-v3/config.h.in | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 17b1199..5889f32 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -1044,6 +1044,9 @@ /* Define if sendfile is available in <sys/sendfile.h>. */ #undef _GLIBCXX_USE_SENDFILE +/* Define to restrict std::__basic_file<> to stdio APIs. */ +#undef _GLIBCXX_USE_STDIO_PURE + /* Define if struct stat has timespec members. */ #undef _GLIBCXX_USE_ST_MTIM |