Allow z/OS to work in either EBCDIC or ASCII mode

IBM has an initiative underway to port various open source projects to
work on z/OS, running under ASCII.  But its native character set is IBM
1047.  This requires a bunch of fancy footwork that they have
undertaken.  One of the necessary things is to be able to set the
character set of a file descriptor.  The __setfdccsid() function does
that, but it and its header file, zos.h, are only defined in ASCII
builds.  This commit allows perl to work in both modes.
This commit is contained in:
Karl Williamson 2025-05-18 12:23:54 -06:00 committed by Karl Williamson
parent 8af62fee44
commit 45a5ce385b
2 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,6 @@
#include <fcntl.h>
#include <libgen.h>
#include <termios.h>
#include <zos.h>
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

9
perl.h
View File

@ -4470,7 +4470,16 @@ intrinsic function, see its documents for more details.
#endif
#if defined(__CYGWIN__) || defined(__MVS__)
void init_os_extras(void);
#endif
#if defined(__MVS__)
# ifdef EBCDIC
# define __setfdccsid(to_fd, bits) 0
# else
# include <zos.h>
# endif
#endif
union any {