Set libgcobol/Makefile.am to define libdir and libsubdir the way libada does.
Reorganize libgcobol/compat directory to group by emulation, not component.
Move orphan gcc/udf/stored-char-length.cbl to the compat directory.
Introduce new POSIX bindings.
gcc/cobol/ChangeLog:
PR cobol/122702
* Make-lang.in: Move stored-char-length.cbl to libgcobol.
libgcobol/ChangeLog:
PR cobol/122702
* Makefile.am: Set libdir and libsubdir per libada example.
* Makefile.in: Regenerate.
* compat/README.md: Revise per new directory structure.
* compat/gnu/lib/CBL_ALLOC_MEM.cbl: Moved from compat/lib/gnu.
* compat/gnu/lib/CBL_CHECK_FILE_EXIST.cbl: Moved from compat/lib/gnu.
* compat/gnu/lib/CBL_DELETE_FILE.cbl: Moved from compat/lib/gnu.
* compat/gnu/lib/CBL_FREE_MEM.cbl: Moved from compat/lib/gnu.
* compat/gnu/udf/stored-char-length.cbl: New file.
* compat/lib/gnu/CBL_ALLOC_MEM.cbl: Moved to compat/gnu/lib.
* compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl: Moved to compat/gnu/lib.
* compat/lib/gnu/CBL_DELETE_FILE.cbl: Moved to compat/gnu/lib.
* compat/lib/gnu/CBL_FREE_MEM.cbl: Moved to compat/gnu/lib.
* posix/cpy/psx-open.cpy: New file.
* posix/shim/open.cc: New file.
* posix/shim/stat.h: Add mode & flag bits for open.cc
* posix/udf/posix-lseek.cbl: New file.
* posix/udf/posix-open.cbl: New file.
* posix/udf/posix-read.cbl: New file.
* posix/udf/posix-write.cbl: New file.
* xmlparse.cc: Quell context_t initialization-order warning.
$(LN) $(GCOBC_INSTALL_NAME)$(exeext) $(GCOBC_TARGET_INSTALL_NAME)$(exeext) ); \
fi; \
fi
- mkdir -p $(DESTDIR)$(datadir)/gcobol/udf
- $(INSTALL_DATA) $(srcdir)/cobol/udf/* $(DESTDIR)$(datadir)/gcobol/udf/
cobol.install-man: installdirs
$(INSTALL_DATA) $(srcdir)/cobol/gcobol.1 $(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME)$(man1ext)
# Written de novo for libgcobol.
+# Standard autoconf-set variables.
+SHELL = @SHELL@
+srcdir = @srcdir@
+libdir = @libdir@
+build = @build@
+target = @target@
+prefix = @prefix@
+
+target_noncanonical = @target_noncanonical@
+version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
+
AUTOMAKE_OPTIONS = 1.8 foreign subdir-objects
ACLOCAL_AMFLAGS = -I .. -I ../config
toolexeclib_LTLIBRARIES = libgcobol.la
toolexeclib_DATA = libgcobol.spec
-libsubincludedir = $(libdir)/gcc/cobol/$(target_noncanonical)/$(gcc_version)
+libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)/cobol
+libsubincludedir = $(libsubdir)
##
## 2.2.12 Automatic Dependency Tracking
libgcobol_la_LIBADD = -lxml2
-nobase_libsubinclude_HEADERS = \
+nobase_libsubinclude_HEADERS = \
posix/cpy/posix-errno.cbl \
posix/cpy/statbuf.cpy \
posix/udf/posix-exit.cbl \
posix/udf/posix-mkdir.cbl \
posix/udf/posix-stat.cbl \
posix/udf/posix-unlink.cbl \
- compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl \
- compat/lib/gnu/CBL_ALLOC_MEM.cbl \
- compat/lib/gnu/CBL_DELETE_FILE.cbl \
- compat/lib/gnu/CBL_FREE_MEM.cbl
+ compat/gnu/lib/CBL_CHECK_FILE_EXIST.cbl \
+ compat/gnu/lib/CBL_ALLOC_MEM.cbl \
+ compat/gnu/lib/CBL_DELETE_FILE.cbl \
+ compat/gnu/lib/CBL_FREE_MEM.cbl \
+ compat/gnu/udf/stored-char-length.cbl
WARN_CFLAGS = -W -Wall -Wwrite-strings
@BUILD_LIBGCOBOL_TRUE@ intrinsic.lo io.lo libgcobol.lo \
@BUILD_LIBGCOBOL_TRUE@ posix/shim/errno.lo \
@BUILD_LIBGCOBOL_TRUE@ posix/shim/localtime.lo \
-@BUILD_LIBGCOBOL_TRUE@ posix/shim/stat.lo stringbin.lo \
-@BUILD_LIBGCOBOL_TRUE@ valconv.lo xmlparse.lo
+@BUILD_LIBGCOBOL_TRUE@ posix/shim/open.lo posix/shim/stat.lo \
+@BUILD_LIBGCOBOL_TRUE@ stringbin.lo valconv.lo xmlparse.lo
libgcobol_la_OBJECTS = $(am_libgcobol_la_OBJECTS)
@BUILD_LIBGCOBOL_TRUE@am_libgcobol_la_rpath = -rpath $(toolexeclibdir)
AM_V_P = $(am__v_P_@AM_V@)
am__nobase_libsubinclude_HEADERS_DIST = posix/cpy/posix-errno.cbl \
posix/cpy/statbuf.cpy posix/udf/posix-exit.cbl \
posix/udf/posix-localtime.cbl posix/udf/posix-mkdir.cbl \
- posix/udf/posix-stat.cbl posix/udf/posix-unlink.cbl \
- compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl \
- compat/lib/gnu/CBL_ALLOC_MEM.cbl \
- compat/lib/gnu/CBL_DELETE_FILE.cbl \
- compat/lib/gnu/CBL_FREE_MEM.cbl
+ posix/udf/posix-open.cbl posix/udf/posix-stat.cbl \
+ posix/udf/posix-unlink.cbl \
+ compat/gnu/lib/CBL_CHECK_FILE_EXIST.cbl \
+ compat/gnu/lib/CBL_ALLOC_MEM.cbl \
+ compat/gnu/lib/CBL_DELETE_FILE.cbl \
+ compat/gnu/lib/CBL_FREE_MEM.cbl \
+ compat/gnu/udf/stored-char-length.cbl
HEADERS = $(nobase_libsubinclude_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
+
+# Standard autoconf-set variables.
SHELL = @SHELL@
SPEC_LIBGCOBOL_DEPS = @SPEC_LIBGCOBOL_DEPS@
STRIP = @STRIP@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
AUTOMAKE_OPTIONS = 1.8 foreign subdir-objects
ACLOCAL_AMFLAGS = -I .. -I ../config
# Skip the whole process if we are not building libgcobol.
@BUILD_LIBGCOBOL_TRUE@toolexeclib_LTLIBRARIES = libgcobol.la
@BUILD_LIBGCOBOL_TRUE@toolexeclib_DATA = libgcobol.spec
-@BUILD_LIBGCOBOL_TRUE@libsubincludedir = $(libdir)/gcc/cobol/$(target_noncanonical)/$(gcc_version)
+@BUILD_LIBGCOBOL_TRUE@libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)/cobol
+@BUILD_LIBGCOBOL_TRUE@libsubincludedir = $(libsubdir)
@BUILD_LIBGCOBOL_TRUE@libgcobol_la_SOURCES = \
@BUILD_LIBGCOBOL_TRUE@ charmaps.cc \
@BUILD_LIBGCOBOL_TRUE@ constants.cc \
@BUILD_LIBGCOBOL_TRUE@ libgcobol.cc \
@BUILD_LIBGCOBOL_TRUE@ posix/shim/errno.cc \
@BUILD_LIBGCOBOL_TRUE@ posix/shim/localtime.cc \
+@BUILD_LIBGCOBOL_TRUE@ posix/shim/open.cc \
@BUILD_LIBGCOBOL_TRUE@ posix/shim/stat.cc \
@BUILD_LIBGCOBOL_TRUE@ stringbin.cc \
@BUILD_LIBGCOBOL_TRUE@ valconv.cc \
@BUILD_LIBGCOBOL_TRUE@ posix/udf/posix-exit.cbl \
@BUILD_LIBGCOBOL_TRUE@ posix/udf/posix-localtime.cbl \
@BUILD_LIBGCOBOL_TRUE@ posix/udf/posix-mkdir.cbl \
+@BUILD_LIBGCOBOL_TRUE@ posix/udf/posix-open.cbl \
@BUILD_LIBGCOBOL_TRUE@ posix/udf/posix-stat.cbl \
@BUILD_LIBGCOBOL_TRUE@ posix/udf/posix-unlink.cbl \
-@BUILD_LIBGCOBOL_TRUE@ compat/lib/gnu/CBL_CHECK_FILE_EXIST.cbl \
-@BUILD_LIBGCOBOL_TRUE@ compat/lib/gnu/CBL_ALLOC_MEM.cbl \
-@BUILD_LIBGCOBOL_TRUE@ compat/lib/gnu/CBL_DELETE_FILE.cbl \
-@BUILD_LIBGCOBOL_TRUE@ compat/lib/gnu/CBL_FREE_MEM.cbl
+@BUILD_LIBGCOBOL_TRUE@ compat/gnu/lib/CBL_CHECK_FILE_EXIST.cbl \
+@BUILD_LIBGCOBOL_TRUE@ compat/gnu/lib/CBL_ALLOC_MEM.cbl \
+@BUILD_LIBGCOBOL_TRUE@ compat/gnu/lib/CBL_DELETE_FILE.cbl \
+@BUILD_LIBGCOBOL_TRUE@ compat/gnu/lib/CBL_FREE_MEM.cbl \
+@BUILD_LIBGCOBOL_TRUE@ compat/gnu/udf/stored-char-length.cbl
@BUILD_LIBGCOBOL_TRUE@WARN_CFLAGS = -W -Wall -Wwrite-strings
@BUILD_LIBGCOBOL_TRUE@AM_CPPFLAGS = -I. -I posix/shim \
posix/shim/$(DEPDIR)/$(am__dirstamp)
posix/shim/localtime.lo: posix/shim/$(am__dirstamp) \
posix/shim/$(DEPDIR)/$(am__dirstamp)
+posix/shim/open.lo: posix/shim/$(am__dirstamp) \
+ posix/shim/$(DEPDIR)/$(am__dirstamp)
posix/shim/stat.lo: posix/shim/$(am__dirstamp) \
posix/shim/$(DEPDIR)/$(am__dirstamp)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlparse.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@posix/shim/$(DEPDIR)/errno.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@posix/shim/$(DEPDIR)/localtime.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@posix/shim/$(DEPDIR)/open.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@posix/shim/$(DEPDIR)/stat.Plo@am__quote@
.cc.o:
At the time of this writing, the functions of greatest concern are
those that are defined by Rocket Software (formerly MicroFocus) and
emulated by GnuCOBOL. Those are implemented in
-`gcc/cobol/compat/lib/gnu`. Any calls they would otherwise make to
+`gcc/cobol/compat/gnu/lib`. Any calls they would otherwise make to
the C library are effected through COBOL POSIX bindings supplied by
`gcc/cobol/posix/udf`.
--- /dev/null
+ >> PUSH source format
+ >>SOURCE format is fixed
+
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * This function is in the public domain.
+ * Contributed by James K. Lowden of Cobolworx in August 2024
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+ Identification Division.
+ Function-ID. STORED-CHAR-LENGTH.
+ Data Division.
+ Linkage Section.
+ 01 Candidate PIC X Any Length.
+ 77 Output-Value PIC 9(8) COMP-5.
+
+ Procedure Division using Candidate RETURNING Output-Value.
+ Move Function Length( Function Trim(Candidate) )
+ to Output-Value.
+ End Function STORED-CHAR-LENGTH.
+
+ >> POP source format
\ No newline at end of file
--- /dev/null
+ >> PUSH source format
+ >>SOURCE format is fixed
+
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * This file is in the public domain.
+ * Contributed by James K. Lowden of Cobolworx in November 2025.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+ * >>DEFINE O_ACCMODE AS 3
+
+ >>DEFINE O_APPEND AS 1024
+ * >>DEFINE O_ASYNC not used by open(2)
+ >>DEFINE O_CLOEXEC AS 524288
+ >>DEFINE O_CREAT AS 64
+ >>DEFINE O_DIRECT AS 16384
+ >>DEFINE O_DIRECTORY AS 65536
+ >>DEFINE O_DSYNC AS 4096
+ >>DEFINE O_EXCL AS 128
+ >>DEFINE O_LARGEFILE AS 32768
+ >>DEFINE O_NOATIME AS 262144
+ >>DEFINE O_NOCTTY AS 256
+ >>DEFINE O_NOFOLLOW AS 131072
+ >>DEFINE O_NONBLOCK AS 2048
+ >>DEFINE O_PATH AS 2097152
+ >>DEFINE O_RDONLY AS 0
+ >>DEFINE O_RDWR AS 2
+ >>DEFINE O_SYNC AS 1052672
+ >>DEFINE O_TMPFILE AS 4194304 + O_DIRECTORY
+ >>DEFINE O_TRUNC AS 512
+ >>DEFINE O_WRONLY AS 1
+
+
+ * >>DEFINE S_IFBLK AS 24576
+ * >>DEFINE S_IFCHR AS 8192
+ * >>DEFINE S_IFDIR AS 16384
+ * >>DEFINE S_IFIFO AS 4096
+ * >>DEFINE S_IFLNK AS 40960
+ * >>DEFINE S_IFMT AS 61440
+ * >>DEFINE S_IFREG AS 32768
+ * >>DEFINE S_IFSOCK AS 49152
+
+ >>DEFINE S_IRGRP AS 32
+ >>DEFINE S_IROTH AS 4
+ >>DEFINE S_IRUSR AS 256
+ >>DEFINE S_IRWXG AS 56
+ >>DEFINE S_IRWXO AS 7
+ >>DEFINE S_IRWXU AS 448
+ >>DEFINE S_ISGID AS 1024
+ >>DEFINE S_ISUID AS 2048
+ >>DEFINE S_ISVTX AS 512
+ >>DEFINE S_IWGRP AS 16
+ >>DEFINE S_IWOTH AS 2
+ >>DEFINE S_IWUSR AS 128
+ >>DEFINE S_IXGRP AS 8
+ >>DEFINE S_IXOTH AS 1
+ >>DEFINE S_IXUSR AS 64
+
+ >> POP source format
+
--- /dev/null
+#include <assert.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <map>
+
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
+extern "C" {
+
+#include "stat.h"
+
+int
+posix_opent(const char *pathname, int cbl_flags, int cbl_mode) {
+
+ static const std::map<int, int> flag_bits {
+ { cbl::PSX_O_RDONLY, O_RDONLY },
+ { cbl::PSX_O_WRONLY, O_WRONLY },
+ { cbl::PSX_O_RDWR, O_RDWR },
+ { cbl::PSX_O_CREAT, O_CREAT },
+ { cbl::PSX_O_EXCL, O_EXCL },
+ { cbl::PSX_O_NOCTTY, O_NOCTTY },
+ { cbl::PSX_O_TRUNC, O_TRUNC },
+ { cbl::PSX_O_APPEND, O_APPEND },
+ { cbl::PSX_O_NONBLOCK, O_NONBLOCK },
+ { cbl::PSX_O_DSYNC, O_DSYNC },
+ { cbl::PSX_O_DIRECT, O_DIRECT },
+ { cbl::PSX_O_LARGEFILE, O_LARGEFILE },
+ { cbl::PSX_O_DIRECTORY, O_DIRECTORY },
+ { cbl::PSX_O_NOFOLLOW, O_NOFOLLOW },
+ { cbl::PSX_O_NOATIME, O_NOATIME },
+ { cbl::PSX_O_CLOEXEC, O_CLOEXEC },
+ { cbl::PSX_O_SYNC, O_SYNC },
+ { cbl::PSX_O_PATH, O_PATH },
+ { cbl::PSX_O_TMPFILE, O_TMPFILE },
+ };
+
+ static const std::map<int, int> mode_bits {
+ { cbl::PSX_S_IXOTH, S_IXOTH },
+ { cbl::PSX_S_IWOTH, S_IWOTH },
+ { cbl::PSX_S_IROTH, S_IROTH },
+ { cbl::PSX_S_IRWXO, S_IRWXO },
+ { cbl::PSX_S_IXGRP, S_IXGRP },
+ { cbl::PSX_S_IWGRP, S_IWGRP },
+ { cbl::PSX_S_IRGRP, S_IRGRP },
+ { cbl::PSX_S_IRWXG, S_IRWXG },
+ { cbl::PSX_S_IXUSR, S_IXUSR },
+ { cbl::PSX_S_IWUSR, S_IWUSR },
+ { cbl::PSX_S_IRUSR, S_IRUSR },
+ { cbl::PSX_S_IRWXU, S_IRWXU },
+ { cbl::PSX_S_ISVTX, S_ISVTX },
+ { cbl::PSX_S_ISGID, S_ISGID },
+ { cbl::PSX_S_ISUID, S_ISUID },
+ };
+
+ int flags = 0;
+ mode_t mode = 0;
+
+ for( auto elem : flag_bits ) {
+ int cbl_bit = elem.first;
+ int std_bit = elem.second;
+
+ if( cbl_bit == (cbl_bit & cbl_flags) ) {
+ flags |= std_bit;
+ }
+ }
+
+ for( auto elem : mode_bits ) {
+ int cbl_bit = elem.first;
+ int std_bit = elem.second;
+
+ if( cbl_bit == (cbl_bit & cbl_mode) ) {
+ mode |= std_bit;
+ }
+ }
+
+ int erc = open(pathname, flags, mode);
+
+ return erc;
+}
+
+} // extern "C"
cbl::time_t psx_mtime; /* Time of last modification */
cbl::time_t psx_ctime; /* Time of last status change */
};
+
+namespace cbl {
+
+ enum flags_t {
+ PSX_O_RDONLY = 0,
+ PSX_O_WRONLY = 1,
+ PSX_O_RDWR = 2,
+ PSX_O_CREAT = 64,
+ PSX_O_EXCL = 128,
+ PSX_O_NOCTTY = 256,
+ PSX_O_TRUNC = 512,
+ PSX_O_APPEND = 1024,
+ PSX_O_NONBLOCK = 2048,
+ PSX_O_DSYNC = 4096,
+ PSX_O_DIRECT = 16384 ,
+ PSX_O_LARGEFILE = 32768,
+ PSX_O_DIRECTORY = 65536,
+ PSX_O_NOFOLLOW = 131072,
+ PSX_O_NOATIME = 262144,
+ PSX_O_CLOEXEC = 524288,
+ PSX_O_SYNC = 1052672,
+ PSX_O_PATH = 2097152,
+ PSX_O_TMPFILE = 4194304 + PSX_O_DIRECTORY,
+ };
+
+ enum open_mode_t {
+ PSX_S_IXOTH = 1,
+ PSX_S_IWOTH = 2,
+ PSX_S_IROTH = 4,
+ PSX_S_IRWXO = 7,
+ PSX_S_IXGRP = 8,
+ PSX_S_IWGRP = 16,
+ PSX_S_IRGRP = 32,
+ PSX_S_IRWXG = 56,
+ PSX_S_IXUSR = 64,
+ PSX_S_IWUSR = 128,
+ PSX_S_IRUSR = 256,
+ PSX_S_IRWXU = 448,
+ PSX_S_ISVTX = 512,
+ PSX_S_ISGID = 1024,
+ PSX_S_ISUID = 2048,
+ };
+
+};
--- /dev/null
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * This function is in the public domain.
+ * Contributed by James K. Lowden of COBOLworx November 2025.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * unsigned long lseek( int fd, unsigned long offset, int whence)
+ Identification Division.
+ Function-ID. posix-lseek.
+ Data Division.
+ Linkage Section.
+ 77 Return-Value Binary-Long.
+ 01 Lk-fd PIC 9(8) Usage COMP.
+ 01 Lk-offset Binary-Long.
+ 01 Lk-whence Binary-Long.
+ Procedure Division using
+ By Value Lk-fd,
+ By Value Lk-offset,
+ By Value Lk-whence
+ Returning Return-Value.
+ Call "lseek" using
+ By Value Lk-fd,
+ By Value Lk-offset,
+ By Value Lk-whence
+ Returning Return-Value.
+ Goback.
+ End Function posix-lseek.
--- /dev/null
+ >>PUSH SOURCE FORMAT
+ >>SOURCE FIXED
+ * int open(const char *pathname, int flags);
+ Identification Division.
+ Function-ID. posix-open.
+
+ Environment Division.
+ Configuration Section.
+ Source-Computer. Sesame-Cookie
+ >>IF DEBUGGING-MODE is Defined
+ With Debugging Mode
+ >>END-IF
+ .
+
+ Data Division.
+ Working-Storage Section.
+ 77 Ws-pathname PIC X(8192).
+ 77 Ws-mode-ptr Pointer.
+ 77 Ws-mode PIC 9(8) Value 0.
+ Linkage Section.
+ 77 Return-Value Binary-Long.
+ 01 Lk-pathname PIC X ANY LENGTH.
+ 01 Lk-flags PIC 9(8).
+ 01 Lk-mode PIC 9(8).
+
+ Procedure Division using
+ By Reference Lk-pathname,
+ By Reference Lk-flags,
+ By Reference Optional Lk-mode
+ Returning Return-Value.
+
+ Move Lk-pathname To Ws-pathname.
+ Inspect Ws-pathname
+ Replacing Trailing Space By Low-Value
+
+ D Display 'posix-open: Ws-pathname ', Ws-pathname.
+ D Perform Show-Flags.
+
+ Set ws-mode-ptr to Address Of Lk-mode.
+
+ If ws-mode-ptr > 0 Then *> O_CREAT requires mode
+ Move Lk-mode to Ws-mode.
+
+ Call "posix_open" using Ws-pathname, Lk-flags, Ws-mode,
+ Returning Return-Value.
+ Goback.
+
+ Show-Flags Section.
+
+ Display 'Flags: ', Function Hex-Of(Lk-flags).
+
+ End Function posix-open.
+ >> POP SOURCE FORMAT
--- /dev/null
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * This function is in the public domain.
+ * Contributed by James K. Lowden of COBOLworx November 2025.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * long read( int fd, void * buf, unsigned long count)
+ Identification Division.
+ Function-ID. posix-read.
+ Data Division.
+ Linkage Section.
+ 77 Return-Value Binary-Long.
+ 01 Lk-fd PIC 9(8) Usage COMP.
+ 01 Lk-buf PIC X ANY LENGTH.
+ 01 Lk-count PIC 9(8) Usage COMP.
+ Procedure Division using
+ By Value Lk-fd,
+ By Reference Lk-buf,
+ By Value Lk-count
+ Returning Return-Value.
+
+ Call "read" using
+ By Value Lk-fd,
+ By Reference Lk-buf,
+ By Value Lk-count
+ Returning Return-Value.
+ Goback.
+ End Function posix-read.
--- /dev/null
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * This function is in the public domain.
+ * Contributed by James K. Lowden of COBOLworx November 2025.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * long write( int fd, const void * buf, unsigned long count)
+ Identification Division.
+ Function-ID. posix-write.
+ Data Division.
+ Linkage Section.
+ 77 Return-Value Binary-Long.
+ 01 Lk-fd PIC 9(8) Usage COMP.
+ 01 Lk-buf PIC X ANY LENGTH.
+ 01 Lk-count PIC 9(8) Usage COMP.
+ Procedure Division using
+ By Value Lk-fd,
+ By Reference Lk-buf,
+ By Value Lk-count
+ Returning Return-Value.
+
+ Call "write" using
+ By Value Lk-fd,
+ By Reference Lk-buf,
+ By Value Lk-count
+ Returning Return-Value.
+ Goback.
+ End Function posix-write.
const int priority;
public:
xmlParserCtxt * ctxt;
- context_t() : ctxt(nullptr), priority(LOG_INFO) {
+ context_t() : priority(LOG_INFO), ctxt(nullptr) {
const int option = LOG_PERROR, facility = LOG_USER;
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
/* Declared in errno.h, when available. */