On 1/8/24 09:10, Anthony Carrico wrote:
On 1/7/24 18:30, Paul Flint wrote:
Gotta try it.

It it up on the dreaded github?

Here is the source Paul:
   https://github.com/acarrico/isctty/blob/master/isctty.c
Just
   $ cc isctty.c
to compile, then
   $ ./a.out
to run.


Here is a curiosity which you may like to investigate:

What happens if a process in another process group opens /dev/tty
and passes the file descriptor to you over a pipe, and then you call
isctty on the received fd?

Is it your controlling terminal or the other process group's controlling terminal?

Would this be a way to get an open fd to device 5,0 that doesn't actually connect to your ctty? Or does it magically now connect to your ctty? Which underlying (virtual) terminal does it use for I/O?

Curious right?

--
Anthony Carrico

Reply via email to