summaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
* Use constexpr for the ASVT offsets and eye-catchersfix/constexpr-constantsSean Kurtz41 hours1-15/+15
| | | | | | | | | | C-PROGRAMMING-STANDARDS.md ยง1.1 asks for typed scalar constants to be constexpr rather than macros, and none of these eight is read by the preprocessor. PRINTFLIKE and WHOSON_VERSION stay macros, for the two reasons the document allows. The names are lower_case so the house .clang-tidy rule for global constants keeps them clean, and each keeps its @brief.
* Merge pull request #26 from skurtz97/fix/c-programming-standardsSean Kurtz41 hours9-186/+536
|\ | | | | Follow C-PROGRAMMING-STANDARDS.md, and stop the EBCDIC report after make check
| * Follow C-PROGRAMMING-STANDARDS.md throughoutfix/c-programming-standardsSean Kurtz41 hours6-168/+441
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standards document that merged as PR #25 is now the reference for the language level, the diagnostics, the names and the comments. What the audit found and this commit settles: - C23 in full: nullptr instead of NULL, static_assert for every offset the walk reads, constexpr for the buffer and column widths, and the one compiler attribute wrapped in PRINTFLIKE so call sites stay C23. - -Wstrict-prototypes and -Wmissing-prototypes, which the document requires and the Makefile did not carry. - Lower-case constexpr names, and static so each stays internal. - A Doxygen block on every function, type, global and macro, and /**< */ on every member, as section 3.3 asks. - -D_OPEN_SYS_FILE_EXT=1, the value the document names, in the Makefile and in .clangd. - make format and make tidy, the two target names the document gives. - The eye-catcher hex, the CHTRKID value and the EBCDIC reasoning now carry the why in a comment rather than standing bare. Where the document and this program disagree, the program keeps its reason and CONTRIBUTING.md records the agreement where it is not obvious. Also fixes the wall of undecodable bytes after `make check`: the runtime's own storage report, and the one the ps child inherits, are EBCDIC text written to an ASCII log. An untagged stdout or stderr is now tagged ISO8859-1 before anything writes to it, so both reports arrive as text.
| * Build as C23 and pin the control-block layoutSean Kurtz41 hours6-50/+100
| | | | | | | | | | | | | | | | | | | | | | The overlays become packed C23 structs, so the offsets are the sum of the field widths instead of hand-written padding, and every field the walk reads is pinned by static_assert. The CSCB and the ASSB are now validated by their eye-catchers (and CHASID for the CSCB) before they supply a userid, a logon procedure or CPU time. The CPU column prints a compact duration instead of hours:minutes:seconds, which read 1947:50:11 for a long session.
| * Merge main: add the C programming standardsSean Kurtz41 hours1-0/+242
| |\ | |/ |/|
* | Merge pull request #25 from skurtz97/add-c-programming-standardsSean Kurtz41 hours1-0/+242
|\ \ | | | | | | Add C-PROGRAMMING-STANDARDS.md as the reference standard
| * | Add C-PROGRAMMING-STANDARDS.md as the reference standardSean Kurtz41 hours1-0/+242
|/ / | | | | | | | | | | | | | | | | The z/OS C and HLASM programming standards for this project: toolchain and warning flags, type and naming rules, clang-format/clang-tidy policy, memory model, EBCDIC/ASCII handling (including zopen character-conversion conventions), control-block access, and POSIX makefile rules. This document is the reference: zash, ztop and whoson all follow it.
| * Declare the port's runtime dependencies and license for zopenport/zopen-runtime-deps-and-licenseSean Kurtz44 hours2-2/+29
|/
* Merge pull request #24 from skurtz97/style/typedef-structsSean Kurtz45 hours2-86/+86
|\ | | | | Name the types with typedefs and keep type names unique
| * Name the types with typedefs and keep type names uniqueSean Kurtz45 hours2-86/+86
|/
* Merge pull request #23 from skurtz97/fix/zopen-compiler-passthroughSean Kurtz45 hours2-9/+5
|\ | | | | Pass zopen's compiler through and find the listing formatter beside it
| * Pass zopen's compiler through and find the listing formatter beside itSean Kurtz45 hours2-9/+5
|/
* Merge pull request #22 from skurtz97/fix/code-review-939f3ecSean Kurtz45 hours5-62/+65
|\ | | | | Fix the code review findings for 939f3ec
| * Fix the code review findings for 939f3ecSean Kurtz45 hours5-62/+65
|/
* Merge pull request #21 from skurtz97/docs/zopen-install-dirSean Kurtz46 hours1-1/+3
|\ | | | | Say where zopen installs when /usr/local/zopen is read-only
| * Say where zopen installs when /usr/local/zopen is read-onlySean Kurtz46 hours1-1/+3
|/
* Merge pull request #20 from skurtz97/fix/zos-checkout-encodingSean Kurtz2 days1-5/+5
|\ | | | | Scope the z/OS encoding to ASCII-only files
| * Scope the z/OS encoding to ASCII-only filesSean Kurtz2 days1-5/+5
|/ | | | | | The blanket zos-working-tree-encoding=ISO8859-1 made a z/OS git clone fail at checkout: README.md has em dashes, which ISO8859-1 cannot represent. Tag only the sources, Makefile and buildenv, which are ASCII.
* Merge pull request #19 from skurtz97/release/1.1v1.1.0Sean Kurtz2 days9-31/+156
|\ | | | | Release 1.1.0 and package as a zopen port
| * Release 1.1.0 and package as a zopen portSean Kurtz2 days9-31/+156
|/ | | | | | | | | | | | | - buildenv: zopen stable line from the release tarball, DEV from main, make check as the port check, install under $ZOPEN_INSTALL_DIR. - Size the session table from ASVTMAXU plus the process count, and stop collapsing SSH rows by ASID, so sessions sharing an address space are all listed. - Read ASSBASST for every session, not only those with a CSCB. - CHANGELOG 1.1.0, VERSION 1.1.0, README/CONTRIBUTING zopen and release steps, CI checks that buildenv agrees with VERSION. - Suppress the Linux-clangd cascade for the z/OS-only headers by its real diagnostic ids.
* Merge pull request #18 from skurtz97/fix/review-552c76cSean Kurtz3 days10-314/+1089
|\ | | | | Fix the code review findings on 552c76c
| * Fix the review findings for 552c76cSean Kurtz3 days10-314/+1089
|/ | | | | | | | | | | | | | CPU time is now TOD units (>> 12) and includes ASSBASST. TSO user and logon procedure come from the CSCB. SSH sessions come from the w_getpsent() process tree and join the address space by ASID. The ASVT walk sizes itself from ASVTMAXU, validates each entry, and a fault while reading a terminated address space skips that row instead of abending. Output follows the zopen character-set convention: ASCII in ISO8859-1 files and IBM-1047 on terminals and pipes, driven by the descriptor tag, with F_CONTROL_CVT saved and restored around the run. README, CHANGELOG, CONTRIBUTING, CI and the issue/PR templates are corrected, and the z/OS 2.5 floor is stated.
* Merge pull request #17 from skurtz97/rewrite/common-storageSean Kurtz5 days4-548/+369
|\ | | | | Read sessions from common storage, one row per session
| * whoson.c: clang-formatSean Kurtz5 days1-10/+10
| |
| * Read sessions from common storage, one row per sessionSean Kurtz5 days4-548/+369
|/ | | | | | | | | | | | | | | | | | | | | | | Replace the ZOAU display parsing with a walk of CVT -> ASVT -> ASCB. The address space list, the TSO/E test (ASCBTSB), the CPU accumulators (ASCBEJST + ASCBSRBT) and the two name pointers (ASCBJBNI, ASCBJBNS) are all in common storage, so the program needs no ZOAU library, no LIBPATH, no console and no authorization. The table is now one row per interactive session and nothing else: the started tasks, OMVS daemons and shell children that used to fill it are gone. TYPE is TSO/E, z/OSMF or SSH. A TSO/E logon is a row because it has a TSO/E session block; it is z/OSMF when the session was logged on by the z/OSMF logon procedure, which is how z/OSMF gets a user in (the z/OSMF Configuration Guide's COMMONPROC/FILEPROC, IZUFPROC by default); an SSH session is an sshd started with -R, since the listener runs without it. PID and the user come from ps -A -o pid,jobname,user,time,args, joined to the address space by job name. JOBNAME and LOGONPROC are separate columns because ASCBJBNI and ASCBJBNS are different names; the CPU counters are printed as hours:minutes:seconds. README and CHANGELOG describe the new design and the three types.
* Merge pull request #16 from skurtz97/docs/install-stepsv1.0.0Sean Kurtz5 days1-3/+9
|\ | | | | README: unpack a release the way z/OS actually wants
| * README: unpack a release the way z/OS actually wantsSean Kurtz5 days1-3/+9
|/ | | | | | | gh release download, gzip, pax, then chtag ISO8859-1: z/OS tar cannot gunzip, and without the chtag IBM make reads the Makefile as a single line and stops with FSUM8705 No target. Verified by building the published v1.0.0 tarball on CBT: warning-free, 57344 bytes, --version prints whoson 1.0.0.
* Merge pull request #15 from skurtz97/ci/changelog-notesSean Kurtz5 days2-3/+15
|\ | | | | release: take the notes from CHANGELOG.md
| * release: take the notes from CHANGELOG.mdSean Kurtz5 days2-3/+15
|/ | | | | | The first release body was GitHub's generated list of every merged PR. The changelog entry for the version is the curated record, so the workflow now extracts that section and refuses a version it cannot find.
* Merge pull request #14 from skurtz97/release/1.0.0Sean Kurtz5 days10-3/+267
|\ | | | | Release 1.0.0: --version, CI and release automation, templates, changelog
| * GitHub: CI, release workflow, templates, changelog, contributingSean Kurtz5 days8-0/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ci.yml checks clang-format (pinned to 23.1.5, since the tool moves line breaks between releases) and that the Makefile still parses under GNU make: the build itself needs z/OS and ZOAU, which no hosted runner has. release.yml runs on a v* tag, refuses one that disagrees with VERSION, archives the sources with git archive, and attaches the tarball and its sha256 to the release. No binary: whoson links the ZOAU 64-bit DLL. Also an issue form that asks for the console display behind a wrong row, a PR template, CONTRIBUTING.md with the build, style and release steps, and CHANGELOG.md with 1.0.0. README gains badges, the usage lines and an install section.
| * whoson: report its version, and keep it in the MakefileSean Kurtz5 days2-3/+16
|/ | | | | | --version and -V print "whoson <version>"; the string comes from VERSION in the Makefile through -DWHOSON_VERSION, so a hand compile still builds and says "unknown". The release workflow refuses a tag that disagrees with it.
* Merge pull request #13 from skurtz97/docs/release-artifactSean Kurtz5 days2-0/+8
|\ | | | | Record that every build is already the release artifact
| * Makefile, README: record that every build is the release artifactSean Kurtz5 days2-0/+8
|/ | | | | | | O3 without -g already; a z/OS program object has no symbol table, so there is nothing for strip to remove: strings finds no function names in the binary, /bin/strip leaves its size alone, and the driver ignores -s as a compile-only flag. Saying so keeps a strip step from being added to no effect.
* Merge pull request #12 from skurtz97/feat/session-detailSean Kurtz5 days4-420/+466
|\ | | | | More about the user: SSH CPU time, session process count, real USERID; make list
| * whoson: report SSH session CPU time, processes and the display USERIDSean Kurtz5 days2-413/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An SSH session had no CPU figure: NA. Its OMVS process reports CT_SECS, so use that, and print both it and the TSO/E CT as seconds.milliseconds through one fmt_cpu() instead of passing the raw text through. PROCS counts what the session is running, by walking the pid tree down from its own process. Counting by address space is wrong: each fork gets its own ASID on z/OS, so the shell is never in the sshd's ASID. USERID= in the DISPLAY TS record is the account; the first column is the job name and the two can differ. Reindent the source to .clang-format (four spaces, attached braces).
| * Makefile: add a list target for Open XL 2.2 compiler listingsSean Kurtz5 days2-7/+20
|/ | | | | | The 2.2 driver can write a JSON listing and ship a formatter for it, so `make list` builds and leaves the pseudo assembly with offsets, grouped by function, in whoson.listing. Clean removes both new files.
* Merge pull request #11 from skurtz97/build/openxl-2.2Sean Kurtz6 days1-1/+1
|\ | | | | Makefile: build with IBM Open XL 2.2 (clang 21.1)
| * Makefile: build with IBM Open XL 2.2 (clang 21.1)Sean Kurtz6 days1-1/+1
|/ | | | | | | | | IBM Open XL C/C++ 2.2 is installed at /usr/lpp/IBM/cnw/v2r2/openxl and is what PATH now resolves ibm-clang to, but the Makefile pins an absolute compiler path, so it kept building with 2.1. Built on cbt with 2.2.0.0 / clang 21.1.1: no warnings with the project's flags, and the binary lists both SSH and TSO/E sessions.
* Merge pull request #10 from skurtz97/fix/tag-redir-out-charsetSean Kurtz6 days1-9/+20
|\ | | | | whoson: convert the opercmd display only when it is EBCDIC
| * whoson: convert the opercmd display only when it is EBCDICSean Kurtz6 days1-9/+20
|/ | | | | | | | | | | | | | | A login shell has _TAG_REDIR_OUT=txt (/etc/profile:114), and with it in the environment opercmd returns the DISPLAY OMVS and DISPLAY TS output already in ASCII. run_display converted it to ASCII a second time, which mixed the two character sets, so both parsers found no rows and an interactive session printed the header and nothing else. Detect the character set of the response instead of assuming it: EBCDIC console text breaks lines with 0x15 and contains no '\n'. Verified on cbt against ZOAU 1.4: interactive zash (full table), the same with _TAG_REDIR_OUT=txt and stdout redirected, and the non-interactive path, which never had the tags.
* Merge pull request #9 from skurtz97/fix/raw-stdoutSean Kurtz6 days2-29/+98
|\ | | | | whoson: write help, errors and the table for the destination's character set
| * whoson: write help, errors and the table for the destination's character setSean Kurtz6 days2-35/+77
| | | | | | | | | | | | | | | | CEE converts stdio output from ASCII to EBCDIC when stdout is a terminal, and sshd converts a command's pipe or socket the other way, so printf was mangled one way or the other. emit() writes with write(2) and converts to EBCDIC only when the descriptor is not a terminal; the help text, usage error, diagnostics and the table all go through it.
| * whoson: write the table with write(2) so CEE leaves it ASCIISean Kurtz6 days2-22/+33
| | | | | | | | | | | | | | CEE converts stdio output from ASCII to EBCDIC when stdout is a terminal, and sshd forwards that pty to the client unchanged, so printf put EBCDIC on the screen. A single buffered write(2) keeps the bytes ASCII on a terminal, a pipe and a redirected file.
| * whoson: emit the table in EBCDIC so pipes stay readableSean Kurtz6 days2-10/+26
|/ | | | | | | | The ASCII build's output was decoded as EBCDIC by the ssh exec channel, so `whoson | grep` and `whoson > file` through the channel produced mojibake (the file bytes themselves were ASCII). Build the table in an ASCII buffer and convert it once with __a2e_l before fwrite, which is what the console and the exec channel both expect.
* Merge pull request #7 from skurtz97/fix/ascii-char-modeSean Kurtz6 days3-16/+24
|\ | | | | Build in ASCII character mode, converting opercmd's EBCDIC display
| * whoson: convert opercmd's EBCDIC display to ASCIISean Kurtz6 days2-6/+12
| | | | | | | | | | | | | | With -fzos-le-char-mode=ascii the literals are ASCII, but opercmd still returns its display in EBCDIC, so every parse matched nothing and only the header printed. Convert each response in place with __e2a_l before the parser sees it, and the stderr text before it is echoed.
| * README: keep the text ASCII so z/OS can check it outSean Kurtz6 days1-1/+1
| | | | | | | | | | | | The em dash is not in ISO8859-1, and .gitattributes tags README.md with zos-working-tree-encoding=iso8859-1, so a checkout on z/OS fails with 'failed to encode README.md from UTF-8 to iso8859-1'.
| * Makefile: build in ASCII character modeSean Kurtz6 days3-14/+16
|/ | | | | | | Switch the default from -fzos-le-char-mode=ebcdic to =ascii (with -O3), so string literals share the ASCII encoding of ZOAU's returned text and of the ssh channel. Install with chmod +x. Docs and code comments followed the old EBCDIC claim.
* Merge pull request #6 from skurtz97/fix/install-chmodSean Kurtz6 days1-0/+1
|\ | | | | Makefile: chmod +x on install