From edaaef601d0d6d263fba87b42d6d04c99dd23dba Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Fri, 21 Sep 2018 21:12:59 +0300 Subject: Use vectored writes when reporting errors and warnings. When producing error and warning messages, libgfortran writes a message by using many system calls. By using vectored writes (the POSIX writev function) when available and feasible to use without major surgery, we reduce the chance that output gets intermingled with other output to stderr. In practice, this is done by introducing a new function estr_writev in addition to the existing estr_write. In order to use this, the old st_vprintf is removed, replaced by direct calls of vsnprintf, allowing more message batching. Regtested on x86_64-pc-linux-gnu. libgfortran/ChangeLog: 2018-09-21 Janne Blomqvist * config.h.in: Regenerated. * configure: Regenerated. * configure.ac: Check for writev and sys/uio.h. * libgfortran.h: Include sys/uio.h. (st_vprintf): Remove prototype. (struct iovec): Define if not available. (estr_writev): New prototype. * runtime/backtrace.c (error_callback): Use estr_writev. * runtime/error.c (ST_VPRINTF_SIZE): Remove. (estr_writev): New function. (st_vprintf): Remove. (gf_vsnprintf): New function. (ST_ERRBUF_SIZE): New macro. (st_printf): Use vsnprintf. (os_error): Use estr_writev. (runtime_error): Use vsnprintf and estr_writev. (runtime_error_at): Likewise. (runtime_warning_at): Likewise. (internal_error): Use estr_writev. (generate_error_common): Likewise. (generate_warning): Likewise. (notify_std): Likewise. * runtime/pause.c (pause_string): Likewise. * runtime/stop.c (report_exception): Likewise. (stop_string): Likewise. (error_stop_string): Likewise. From-SVN: r264487 --- libgfortran/ChangeLog | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'libgfortran/ChangeLog') diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 4c20390656f..d7447406615 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,32 @@ +2018-09-21 Janne Blomqvist + + * config.h.in: Regenerated. + * configure: Regenerated. + * configure.ac: Check for writev and sys/uio.h. + * libgfortran.h: Include sys/uio.h. + (st_vprintf): Remove prototype. + (struct iovec): Define if not available. + (estr_writev): New prototype. + * runtime/backtrace.c (error_callback): Use estr_writev. + * runtime/error.c (ST_VPRINTF_SIZE): Remove. + (estr_writev): New function. + (st_vprintf): Remove. + (gf_vsnprintf): New function. + (ST_ERRBUF_SIZE): New macro. + (st_printf): Use vsnprintf. + (os_error): Use estr_writev. + (runtime_error): Use vsnprintf and estr_writev. + (runtime_error_at): Likewise. + (runtime_warning_at): Likewise. + (internal_error): Use estr_writev. + (generate_error_common): Likewise. + (generate_warning): Likewise. + (notify_std): Likewise. + * runtime/pause.c (pause_string): Likewise. + * runtime/stop.c (report_exception): Likewise. + (stop_string): Likewise. + (error_stop_string): Likewise. + 2018-09-16 Thomas Koenig PR fortran/37802 -- cgit v1.2.1