Stop other processes from writing to tty

I am interested in stopping all processes other than the one I am writing from printing to the tty in which my process is running. It can be assumed that my application is only to be ran in a real tty.

I would prefer a POSIX compliant solution, but ubuntu or freeBSD specific solutions would be appreciated as well. The system I am coding on is Ubuntu 14.

I am writing in C, but portability is not so much of a concern that I would need to avoid system calls, nonstandard headers (like POSIX headers), etc.

I am having a hard time seeing where to start with this. I thought maybe stty would have a command for it, but I couldn’t find one in its man page.

To illustrate my issue, my application uses the terminal as a character grid rather than a sequence of lines, so when a keyboard is plugged in, I get output regarding configuration, which overwrites the characters I have in place. I am about to resort to regular reprinting of the entire screen, but I’d really like to avoid that. So, to do that, I really need to stop other processes from writing to the tty.

Thanks in advance!

Stop other processes from writing to tty