Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Jan 2024 14:00:36 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 276220] tty_disc canonical input processing: suprising behavior of the EOF cchar
Message-ID:  <bug-276220-99-y2ZPIfsSJl@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-276220-99@https.bugs.freebsd.org/bugzilla/>
References:  <bug-276220-99@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276220

--- Comment #1 from hym2209268914@gmail.com ---
a minimal example, try to press 'hello^D' and observe it terminating
surprisingly.

```
#include <unistd.h>

int main() {
    char buffer[5];
    ssize_t nread;

    while ((nread =3D read(STDIN_FILENO, buffer, 5)) > 0) {
        write(STDOUT_FILENO, buffer, nread);
    }

    return 0;
}
```

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276220-99-y2ZPIfsSJl>