From ad8c9a5807dbdd5c90578c24a13371edbcfbe3b5 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Fri, 26 Jul 2024 17:15:27 +0200 Subject: [PATCH] os400: workaround an IBM ASCII run-time library bug IBM-provided ASCII function puts() does not output an expected trailing newline: emulate the correct behavior using other functions. Closes #14281 --- lib/setup-os400.h | 9 +++++++++ packages/OS400/README.OS400 | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/setup-os400.h b/lib/setup-os400.h index 9dd546e9b1..ef7baca67e 100644 --- a/lib/setup-os400.h +++ b/lib/setup-os400.h @@ -38,6 +38,15 @@ typedef unsigned long u_int32_t; #define isatty(fd) 0 +/* Workaround bug in IBM QADRT runtime library: + * function puts() does not output the implicit trailing newline. + */ + +#include /* Be sure it is loaded. */ +#undef puts +#define puts(s) (fputs((s), stdout) == EOF? EOF: putchar('\n')) + + /* System API wrapper prototypes & definitions to support ASCII parameters. */ #include diff --git a/packages/OS400/README.OS400 b/packages/OS400/README.OS400 index 38b2c7f06c..1bc4132f67 100644 --- a/packages/OS400/README.OS400 +++ b/packages/OS400/README.OS400 @@ -226,8 +226,7 @@ in fact, very few common utilities are available. As a consequence, the config-os400.h has been coded manually and the compilation scripts are a set of shell scripts stored in subdirectory packages/OS400. - The "curl" command and the test environment are currently not supported on -OS/400. + The test environment is currently not supported on OS/400. Protocols currently implemented on OS/400: