top | item 12795950

(no title)

a-no-n | 9 years ago

Thx. For an encore:

    /* must be run as root */
    #include <signal.h>
    main(){for(;;){kill(-1,SIGCONT);sleep(10);}}

and a .plist. Temporary hackaround.

discuss

order

garblegarble|9 years ago

What does -1 do, send that signal to all processes?

Sidnicious|9 years ago

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.)

tokenizerrr|9 years ago

Yup. From man kill:

    -1

    All processes with pid larger than 1 will be signaled.

EdwinHoksberg|9 years ago

Yes, but not for the current process and init

merpnderp|9 years ago

To all with a PID > -1