I wrote a small program to send a character to a terminal other than my own. I moved to 64-bit recently and the program fails.
I open a terminal with:
Code:
hTTY = open(/dev/tty3, O_WRONLY|O_NONBLOCK);
then send a character with:
Code:
result=ioctl(hTTY, TIOCSTI, argv[2]);
The open succeeds but the ioctl fails with errno=1, Operation not permitted.
If I send to its own tty it works. Ownership and permissions of the target terminal don't matter. If I do it as root it works.
What's the difference between 32 and 64 bit?