c - How can I suspend/kill a child process from the child using keyboard? -


in shell program reading keyboard via readline:

rl_bind_keyseq ("\\c-c", readline_func); // ctrl + c  int readline(...){     // handle keyboard controls } 

this works when i'm in outside loop, once long command such 'wc' i'm in child process, ctrl+c not being picked up, ^c in terminal. keystrokes defined before forked.

i'm interested in killing process, when i'm running 'wc' , ctrl+c detected, i'll kill(pid, sigint)

my parent process waiting child via:

waitpid(pid, &child_status, 0); 

also able call kill within child stop/pause?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -