<feed xmlns='http://www.w3.org/2005/Atom'>
<title>zash.git/src/sys_zos.c, branch bench/compat-triage</title>
<subtitle>Fast Almquist-family POSIX shell for z/OS UNIX with bundled libedit</subtitle>
<id>https://git.abendless.com/zash.git/atom?h=bench%2Fcompat-triage</id>
<link rel='self' href='https://git.abendless.com/zash.git/atom?h=bench%2Fcompat-triage'/>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/'/>
<updated>2026-11-25T06:31:26Z</updated>
<entry>
<title>C23: nullptr for null pointers, constexpr for typed constants</title>
<updated>2026-11-25T06:31:26Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-25T06:30:44Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=c7f23b8a5fb86f8df51809aca64415bcadcaa9f6'/>
<id>urn:sha1:c7f23b8a5fb86f8df51809aca64415bcadcaa9f6</id>
<content type='text'>
nullptr in every place a null pointer constant was meant; NULL is gone
from src/.

constexpr where it improves on #define without costing anything: the
IGGCSI00 work-area offsets and sizes, and the scalar sizes MVS_DSN_MAX,
CSI_FIELD_LEN, CSI_WORK_MIN, PDS_DIRBLK, CSI_WORK, CSI_MAX_CALLS.  A
constexpr in C is a constant expression, so it still bounds the arrays
that use it, and it now carries a type and can be checked with
static_assert.  Feature switches (#if), the CSIETYPE/EBCDIC byte
constants read as octets, and the related-constant enum sets stay as
they were.
</content>
</entry>
<entry>
<title>build: 64-bit on z/OS</title>
<updated>2026-11-25T05:21:27Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-25T05:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=da07f0274c8c92e0ff5f2e4a66fb867a12f2cf08'/>
<id>urn:sha1:da07f0274c8c92e0ff5f2e4a66fb867a12f2cf08</id>
<content type='text'>
The 31-bit choice existed for one reason: a 64-bit start cost 29 ms
against 1 ms and a 64-bit fork() 4.2 ms against 0.10.  That was the
64-bit C run-time being loaded out of CEE.SCEERUN2 on the linklist on
every start; with CELQ* in the dynamic LPA both widths cost 1.5 ms and
fork() 0.10 ms (notes/investigation.md has the before and after).

So build the shell at the width IBM builds for: -m64 for both the
ASCII and the EBCDIC build, and for the debug build.

OS_UPSTACK does not exist at -m64, so the two AMODE 31 services
(IGGCSI00, BPXWDY2) are declared with plain OS linkage, which is what
the 64-bit glue implements.  IGGCSI00's VL bit is set from the width of
a pointer now, not with 0x80000000.  Neither module loads on this
system, so the linkage itself stays unverified; csi_call() still traps a
program check and retires the catalog if it abends.
</content>
</entry>
<entry>
<title>z/OS: keep a close-on-exec pipe out of the child's fd map</title>
<updated>2026-11-23T17:09:45Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-23T17:09:45Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=92fb4b12ac631ce5c794e5b5b29f204f34ab9e59'/>
<id>urn:sha1:92fb4b12ac631ce5c794e5b5b29f204f34ab9e59</id>
<content type='text'>
sys_pipe() duplicates the shell's pipe ends above SYS_NFD and marks them
FD_CLOEXEC, so that other children do not inherit them.  spawn()'s fd_map
hands the child the parent's descriptor as it is, without clearing the
flag the way dup2() would, so a mapping onto the child's 0..2 carried
FD_CLOEXEC into the child.  The child could still write, but the next
exec inside it lost stdout: ps printed

    FSUM6004 write error on standard output: EDC5113I Bad file descriptor

and a #!/bin/sh shim lost the pipe it was given.

Pass a plain duplicate, which fcntl F_DUPFD makes above SYS_NFD without
the flag, for every map entry that names a different descriptor, and
close the duplicates once spawn() has made the child.  Entries that map
a descriptor onto itself are untouched.

tests/zos/fdmap.sh records the case: a pipe the shell made, read by a
child that execs.

Reported in #1.
</content>
</entry>
<entry>
<title>z/OS: run 31-bit and load IGGCSI00 through the C library</title>
<updated>2026-11-23T17:09:32Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-23T17:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=d1ea4c7f4530e3d1d4689a9d20029a0c1a418df5'/>
<id>urn:sha1:d1ea4c7f4530e3d1d4689a9d20029a0c1a418df5</id>
<content type='text'>
zash was AMODE 64, so calling the AMODE 31 IGGCSI00 needed assembler
glue (zos_csi.s) that switched addressing mode around the branch.  Built
with -m32 the program is 31-bit itself: the call goes through a plain
function pointer, the work area and the saved registers live in one
31-bit block in C, and the glue is gone.

The rest of the tree follows the change: the build, the off-z/OS lint
shim, DESIGN.md and README.md, the benches, the Lean spec of the
pattern matcher, and the tests that recorded what the extra address bits
had changed.
</content>
</entry>
<entry>
<title>z/OS: load IGGCSI00 once and keep the block for the shell</title>
<updated>2026-11-20T00:28:13Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-20T00:28:13Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=a37d3adca684abd6ccca77c58732515efde9dd76'/>
<id>urn:sha1:a37d3adca684abd6ccca77c58732515efde9dd76</id>
<content type='text'>
The search interface was reached through LINK, which asked the system to
find and attach the module on every call -- and completion issues a call
per Tab.  The glue now LOADs the module on the first call, writes its
entry point into the block, and branches to it directly afterwards, and
the block itself is taken from 31-bit storage on the first search and
kept, because IGGCSI00 is AMODE 31 and all three of its addresses have
to stay below 2 GB.

The block is declared packed, so the compiler cannot add padding the
assembler's offsets do not know about, and aligned(8), so the save area
starts on a doubleword.  Its name field is spelled in IBM-1047 bytes
rather than as a C string, so the module is named the same way whatever
character mode this build runs in.

Verified on the machine: SYS1.MA* returns SYS1.MACLIB, SYS1.* returns
135 names, and Tab in an interactive shell completes //'SYS1.MA to
//'SYS1.MACLIB' and lists the members of that PDS.
</content>
</entry>
<entry>
<title>docs: say it in short sentences</title>
<updated>2026-11-19T00:04:28Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-19T00:04:28Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=d51368ffc48a1521796e5f582b489306da5fd5ce'/>
<id>urn:sha1:d51368ffc48a1521796e5f582b489306da5fd5ce</id>
<content type='text'>
DESIGN.md, README.md and the Doxygen comments leaned on semicolons to
join clauses and on trailing "which" clauses to add afterthoughts. Both
read as machine-written prose. Each joined clause is now its own
sentence, and the afterthoughts are either part of the sentence or a
sentence of their own.

Also corrected: README said C11 in two places (the tree builds C17), the
completion section still described the pre-HLQ-rule filters and the
64-call resume limit, and the z/OS job-control note still called
SPAWN_SETTCPGRP unverified.
</content>
</entry>
<entry>
<title>z/OS: test a spawn with the script's whole descriptor range open</title>
<updated>2026-11-18T23:05:49Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-18T23:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=79141a999257c915bf9987e32c7530a67700cab1'/>
<id>urn:sha1:79141a999257c915bf9987e32c7530a67700cab1</id>
<content type='text'>
A script owns descriptors 0..SYS_NFD-1 and the shell's own live above
them, so filling 3..9 is as far as a script can go; the spawn map keeps
the terminal duplicate reachable past them.  The earlier '64' map was
guessing at a case the shell cannot present: back to SYS_NFD+16.
</content>
</entry>
<entry>
<title>z/OS: bound the below-the-bar storage CSI completion uses</title>
<updated>2026-11-18T22:51:30Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-18T22:51:30Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=0a33a3a6af8aedea339fc1e0defdb421473949cb'/>
<id>urn:sha1:0a33a3a6af8aedea339fc1e0defdb421473949cb</id>
<content type='text'>
One 64 KB block, freed before the search returns, and a nested search is
refused rather than given a second one.  The second catalog search is
skipped once the candidate list is full.
</content>
</entry>
<entry>
<title>z/OS: a wider spawn map, and the suite runs both builds</title>
<updated>2026-11-18T21:13:09Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-18T21:13:09Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=0d69168ada30c4b584a6c3aa77640d2b396d9599'/>
<id>urn:sha1:0d69168ada30c4b584a6c3aa77640d2b396d9599</id>
<content type='text'>
The map carried SYS_NFD+16 descriptors, so a script holding more pushed
the terminal's duplicate out of reach and its commands lost the
controlling terminal.  64 leaves room.

`make zos-check` now builds the EBCDIC program too and runs the
character-set tests against it, which nothing did before.
</content>
</entry>
<entry>
<title>z/OS: keep the terminal descriptor open for spawn</title>
<updated>2026-11-18T19:54:33Z</updated>
<author>
<name>Sean Kurtz</name>
<email>seankurtz75@gmail.com</email>
</author>
<published>2026-11-18T19:54:33Z</published>
<link rel='alternate' type='text/html' href='https://git.abendless.com/zash.git/commit/?id=2e971a63ff71b0393623025b93ce17716aa938e3'/>
<id>urn:sha1:2e971a63ff71b0393623025b93ce17716aa938e3</id>
<content type='text'>
spawn() sets the child's foreground process group from inherit.ctlttyfd
after it has closed every descriptor from fd_count up, so the shell's
terminal descriptor -- which lives above the script's five or so -- was
already gone by then.  Every external command in an interactive shell
died with EDC5113I Bad file descriptor, while the same command outside a
terminal worked.

Carry the terminal descriptor in the fd map, so the child has it open for
exactly the tcsetpgrp() spawn() performs.
</content>
</entry>
</feed>
