Search code examples
linuxterminalratepty

Does terminal control function setting baud rate really effective for pseudo terminals?


I know:

Nowadays, when we logon linux, either desktop or by ssh remote, the linux system allocates a pseudo terminal under /dev/pty for us, right?

My question:

So some unix functions which is used to set baud rate: seems they're for real physical devices, are they still effective for pseudo terminals?


Solution

  • The baud rate setting for a pseudo-terminal doesn't control anything, but advises the terminal driver (when it matters) how to synchronize with a physical device, as well as advising applications if they should send padding characters.

    A pseudo-terminal might be connected to a physical device, but there's no way for an application to tell the difference. Physical devices are still used (perhaps not by you).

    For example, xterm has an option, used for testing ncurses:

    Patch #327 - 2016/10/07
    add -baudrate option, for testing ncurses.

    but you would not find it useful.