aboutsummaryrefslogtreecommitdiffstats
path: root/pw-relnotes.5
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-06-08 22:59:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-06-08 22:59:40 -0700
commitd2ae79caf381389d5bda82b324ec82f980e4a6a8 (patch)
tree9610f3ee93bb1ccf50bb874da4083efd86124592 /pw-relnotes.5
parent53cb074b0db3fb20b1496ef608bb6b7fadad59ad (diff)
downloadpw-d2ae79caf381389d5bda82b324ec82f980e4a6a8.tar.gz
pw-d2ae79caf381389d5bda82b324ec82f980e4a6a8.tar.bz2
pw-d2ae79caf381389d5bda82b324ec82f980e4a6a8.zip
Feature: implement pass-through mode.
In pass-through mode, pw can be used in the middle of a pipeline, or redirected to a file or device. Then instead of discarding data, it copies from standard input to standard output. pw's implementation assumes that standard output is the terminal, and uses some functions that operate implicitly on standard output. To avoid changing all that code, dup2 calls are used to rearrange the file descriptors. The tty descriptor opened from /dev/tty is installed as standard output, and the original standard output (the device, file or pipe to which data is to be passed through) is tied to a dedicated stream held in the local variable out. Whenever out is not null, bytes are to be sent to it rather than discarded. In pass-through mode, though, standard output is not the terminal.
Diffstat (limited to 'pw-relnotes.5')
0 files changed, 0 insertions, 0 deletions