While looking at the scsh-0.7 source code from https://github.com/scheme/scsh for details about how it handles syncing, especially the misnamed (sync-file-system), which in the UNIX world should be called (sync-file-systems), since the UNIX sync system call traditionally schedules all the file systems to synchronize ASAP, I discovered the code base has been substantially modified, and at least one grievous error was introduced in the process:

File scsh-0.6.7scheme/syscalls.scm is correct (including the comment):

;;; Amazingly bogus syscall -- doesn't *actually* sync the filesys.
(import-os-error-syscall sync-file-system () "scsh_sync")

In scsh-0.7 that code has been moved to scheme/file-syscalls.scm, there's a change to the %[internal code convention] from the unadorned name, and it incorrectly demands an argument, because it then calls fsync rather than sync!?!??:

;;; Amazingly bogus syscall -- doesn't *actually* sync the filesys.
(import-lambda-definition-2 %sync-file-system (fd) "scsh_fsync")

Which only promises to update a file's cached data, not everything that's in that file system; perhaps this was a change meant to make the behavior better match the name....

So, as a proof of concept scsh-0.7 is still adequate, it's obviously making some number of system calls correctly using the latest version of Scheme 48 like the open/read/close-directory set which I previously tried, and it might contain useful changes for newer operating systems, but it looks like the official scsh-0.6.7 should be considered the canonical source.

Action item request for the SRFI document:

Make sync-file-system plural, and add a caveat to the Implementation section noting the name change and that the original was broken in the 0.6.7 -> 0.7 process.

- Harold