Re:Task_t considered harmful
by gbrown_ on Wednesday October 26, 2016 @07:35AM
(#12795613)
Nice use of -1 there.
[ Parent
| on HN ]
Thx. For an encore:
/* must be run as root */
#include <signal.h>
main(){for(;;){kill(-1,SIGCONT);sleep(10);}}
and a .plist. Temporary hackaround.
Re:Task_t considered harmful
by garblegarble on Wednesday October 26, 2016 @08:46AM
(#12795974)
What does -1 do, send that signal to all processes?
Re:Task_t considered harmful
by Sidnicious on Wednesday October 26, 2016 @09:02AM
(#12796080)
I was going to say that it signals launchd's process group — every process spawned by launchd, which always runs with PID 1. However, the `kill` manpage confirms your hunch:
-1 If superuser, broadcast the signal to all processes; otherwise
broadcast to all processes belonging to the user.
(This is on macOS/iOS, Linux might have slightly different semantics.)
Re:Task_t considered harmful
by tokenizerrr on Wednesday October 26, 2016 @08:56AM
(#12796033)
Yup. From man kill:
-1
All processes with pid larger than 1 will be signaled.
Re:Task_t considered harmful
by EdwinHoksberg on Wednesday October 26, 2016 @08:56AM
(#12796038)
Yes, but not for the current process and init