NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: cannot disable output processing in pseudo-terminal (between openpty(3) parent and child)
On Sun, Jul 30, 2023 at 23:04:23 +0000, pouya+lists.netbsd%nohup.io@localhost wrote:
> One of my use cases requires the child process to emit a binary
> stream to be read by the parent. The parent is notified first via
> a specific escape sequence. This almost works, except I can't
> figure out how to disable output processing on this stream, and in
> particular the parent receives extra CR characters for every LF
> (NL) the child sends.
>
> I have tried setting every file descriptor I could think of to raw
> mode (parent stdin, child stdin, both sides of the duplex fd between
> parent and child) via the tcsetattr(3) gymnastics mentioned above,
> to no avail.
FWIW, I have a simple program I've been using to debug kernel vt100
emulator, and:
$ ./wsemul -- printf '\n'
$ hexdump -C wsemul.raw
00000000 0d 0a |..|
00000002
$ ./wsemul -- sh -c 'stty raw; printf "\n";'
$ hexdump -C wsemul.raw
00000000 0a |.|
00000001
where wsemul.raw is the (unfortunately named) dump of everything
received from the slave on the master side.
The program doesn't do anything fancy with the pty.
https://hg.sr.ht/~nbuwe/wsemul/browse/run.c?rev=tip
-uwe
Home |
Main Index |
Thread Index |
Old Index