On 24.05.2019 11:25, Robert Elz wrote: > Date: Fri, 24 May 2019 06:34:58 -0000 (UTC) > From: mlelstv%serpens.de@localhost (Michael van Elst) > Message-ID: <qc83ai$ded$1%serpens.de@localhost> > > | That's probably the shell that must read input byte by byte in most cases. > > The shell actually very rarely does one byte reads when not reading > from the terminal (and even then only for command line editing). > > That used to be important in the pre Bourne-shell days, but the time > of the shell passing the open script to child processes to read from > are long gone - and without that, it isn't as important that there > be no readahead. > > Of course, if something is passing it one byte at a time through a pipe > (doing unbuffered writes to a pipe) then anything is possible. > > kre > I've pushed few patches to NetBSD truss(1) to GitHub. It prints now program name for the -f option and decodes properly text string for read(2). ./truss -o /tmp/log.txt -f /usr/src/build.sh Part of log.txt: 8836 sh read(12, "#!/bin/sh\n#\n#\t$NetBSD: osrelease", 1016)= 0x3f8 8836 sh read(12, "O EVENT SHALL THE FOUNDATION OR ", 1016)= 0x3f8 8836 sh open("/usr/src/sys/conf/../sys/param.h"..., O_RDONLY)= 0x3 8836 sh dup2() = 0 8836 sh close(3) = 0 8836 sh read(0, "/", 1) = 0x1 8836 sh read(0, "*", 1) = 0x1 8836 sh read(0, "\t", 1) = 0x1 8836 sh read(0, "$", 1) = 0x1 8836 sh read(0, "N", 1) = 0x1 8836 sh read(0, "e", 1) = 0x1 8836 sh read(0, "t", 1) = 0x1 8836 sh read(0, "B", 1) = 0x1 8836 sh read(0, "S", 1) = 0x1 8836 sh read(0, "D", 1) = 0x1 8836 sh read(0, ":", 1) = 0x1 8836 sh read(0, " ", 1) = 0x1 8836 sh read(0, "p", 1) = 0x1 8836 sh read(0, "a", 1) = 0x1 8836 sh read(0, "r", 1) = 0x1 8836 sh read(0, "a", 1) = 0x1 8836 sh read(0, "m", 1) = 0x1 8836 sh read(0, ".", 1) = 0x1 8836 sh read(0, "h", 1) = 0x1 8836 sh read(0, ",", 1) = 0x1
Attachment:
signature.asc
Description: OpenPGP digital signature