I have a child process which runs in a pseudo terminal. The parent process does not run as root, but the child process does, through su or sudo. Because of this it is not possible to send a signal to the child process to force it to exit. I want to force it to exit by one of these means:
- emulating a Ctrl-C.
- emulating a terminal hangup.
How do I do either of these? I already have a pty master fd, and I've tried something like this:
write(master, &termios.c_cc[VINTR], 1)
but it doesn't do anything.