Skip to content

Commit 45a5ce3

Browse files
committed
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.
1 parent 8af62fe commit 45a5ce3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

os390/os390.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <fcntl.h>
1212
#include <libgen.h>
1313
#include <termios.h>
14-
#include <zos.h>
1514
#include "EXTERN.h"
1615
#include "perl.h"
1716
#include "XSUB.h"

perl.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4470,7 +4470,16 @@ intrinsic function, see its documents for more details.
44704470
#endif
44714471

44724472
#if defined(__CYGWIN__) || defined(__MVS__)
4473+
44734474
void init_os_extras(void);
4475+
4476+
#endif
4477+
#if defined(__MVS__)
4478+
# ifdef EBCDIC
4479+
# define __setfdccsid(to_fd, bits) 0
4480+
# else
4481+
# include <zos.h>
4482+
# endif
44744483
#endif
44754484

44764485
union any {

0 commit comments

Comments
 (0)