NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/45352: pty(4)/tty(4) have a 1024 bytes transfer limit
The following reply was made to PR kern/45352; it has been noted by GNATS.
From: Matthew Mondor <mm_lists%pulsar-zone.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/45352: pty(4)/tty(4) have a 1024 bytes transfer limit
Date: Fri, 23 Sep 2011 09:42:26 -0400
On Fri, 23 Sep 2011 13:30:06 +0000 (UTC)
Matthew Mondor <mm_lists%pulsar-zone.net@localhost> wrote:
> NetBSD-5 with -s 1024: reaches a 1022 bytes read limit
>
> parent: started; opening PTY and spawning child
> parent: sleeping to make sure child is ready
> child: started; open "/dev/pts/11"
> child: TTY open, starting read loop
> child: polling
> parent: writing
> parent: attempting to write 1024 bytes to PTY
> child: attempting to read 1024 bytes
> parent: wrote 1024 bytes to PTY
> parent: attempting to write 1024 bytes to PTY
> child: read 1022 bytes from TTY
> child: attempting to read 1024 bytes
> parent: wrote 1024 bytes to PTY
> parent: waiting for child to exit
> child: read 1022 bytes from TTY
> child: attempting to read 1024 bytes
> child: polling
> child: closing TTY
> child: exiting
> parent: closing PTY
> parent: exiting
> Linux with -s 4096: reaches a 4095 bytes read limit
>
> parent: started; opening PTY and spawning child
> parent: sleeping to make sure child is ready
> child: started; open "/dev/pts/8"
> child: TTY open, starting read loop
> child: polling
> parent: writing
> parent: attempting to write 4096 bytes to PTY
> parent: wrote 4096 bytes to PTY
> parent: attempting to write 4096 bytes to PTY
> parent: wrote 4096 bytes to PTY
> parent: waiting for child to exit
> child: attempting to read 4096 bytes
> child: read 4095 bytes from TTY
> child: attempting to read 4096 bytes
> child: read 4095 bytes from TTY
> child: attempting to read 4096 bytes
> child: read 2 bytes from TTY
> child: attempting to read 4096 bytes
> child: polling
> child: closing TTY
> child: exiting
> parent: closing PTY
> parent: exiting
Oh, another particularity is that there also appear to be lost bytes at
the end; On Linux there is a last smaller read to fill in the missing
bytes. The larger the buffer size the more bytes are lost in our case.
Thanks,
--
Matt
Home |
Main Index |
Thread Index |
Old Index