@J.C.
It never occurred to me try this under the emulator (I have to build on a separate machine for that), so this is the first I've seen of these problems.
Something very strange is going on in the emulated program. Using
strace, I can see the output being written to stdout if it isn't redirected. If it is redirected (with '>' or e.g. 'FILE=``'), then strace shows that the write never takes place to
any file descriptor. The emulator code just swallows it. It looks like I can get around it by dup'ing stdout and writing to that descriptor instead. Sigh! Such a short program, and it's already kludgy!

I'll post here when the changes are uploaded.