HI
I would like to pass new argument to cureently running process with out interuption in unix using c code
can any one Idea on this
Please suggest
Thanks in Advance
Madan
HI
I would like to pass new argument to cureently running process with out interuption in unix using c code
can any one Idea on this
Please suggest
Thanks in Advance
Madan
was right that a signal is the usual trigger, but a signal alone only notifies a process — it does not carry arbitrary text arguments. The robust pattern is to have the running program cooperate: use a signal to tell the process "read new input now", and then deliver the actual argument(s) through a control channel (file, FIFO, Unix-domain socket) or, for small numeric values, via sigqueue. This avoids restarting the process and keeps handling deterministic. See the signal overview for behavior details (signal(7)).
A minimal, safe workflow:
sigaction with SA_SIGINFO or use signalfd to handle signals synchronously).volatile sig_atomic_t flag (or read the queued value from siginfo_t if using sigqueue) and return quickly./var/run/app.cmd or a FIFO/Unix socket) and apply them.Example handler sketch:
static void on_sig(int sig, siginfo_t *si, void *u) {
pending = 1; /* sig_atomic_t flag */
queued = si ? si->si_value.sival_int : 0;
}
/* install with sigaction(SA_SIGINFO) */ For small additional data, sigqueue can attach a small integer (sigqueue(3)). For richer commands use a FIFO or Unix socket (fifo(7), unix(7)). Avoid doing heavy work in a signal handler and validate all inputs to avoid security/race issues.
Jump to Post— ahamed101 40Can you please elaborate.... I didn't get you actually...
Can you please elaborate.... I didn't get you actually...
Send a signal.
HI Thanks it i sworking fine
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.