Skip to content
systemcoding.dev

Snippets

Short posts that solve one thing: the code, the output we got, and why it works.

Systems Programming

Get the terminal device name with ttyname

Get the path of the terminal attached to a file descriptor with ttyname or the thread-safe ttyname_r, which returns NULL when it is not a terminal.

1 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.