peter wrote:
Dear All
ProcessBuilder pb = new ProcessBuilder(bochsPath, "-q", "-f",
"bochsrc.bxrc");
pb.directory(new File("test"));
pb.redirectErrorStream(true);
p = pb.start();
p.getOutputStream.write((byte)0x3); <---- I want to send a SININT,
ctrl -c signal, but not working
0x3 is just a value - it doesn't trigger a signal unless the OS receives
a command to send a signal. The keyboard driver has a trap to convert
"Ctrl-C" into a signal, which the OS delivers instead of a byte with
value 3. What you did is bypass that mechanism and simply send the byte.
You can see this in Linux or Cygwin or any bash shell environment by
entering the command
$ echo $'\x3'this is a test
That merely sends the byte "0x03" to the output but does not raise the
signal that Ctrl-C would.
I'm sorry; I don't know how to send the signal.
a "kill -int <PID>" to it.