Kirill Korotaev <[email protected]> writes:
>> + * kill_pspace_info() sends a signal to all processes in a process space.
>> + * This is what kill(-1, sig) does.
>> + */
>> +
>> +int __kill_pspace_info(int sig, struct siginfo *info, struct pspace *pspace)
>> +{
>> + struct task_struct *p = NULL;
>> + int retval = 0, count = 0;
>> +
>> + for_each_process(p) {
>> + int err;
>> + /* Skip the current pspace leader */
>> + if (current_pspace_leader(p))
>> + continue;
>> +
>> + /* Skip the sender of the signal */
>> + if (p->signal == current->signal)
>> + continue;
>> +
>> + /* Skip processes outside the target process space */
>> + if (!in_pspace(pspace, p))
>> + continue;
>> +
>> + /* Finally it is a good process send the signal. */
>> + err = group_send_sig_info(sig, info, p);
>> + ++count;
>> + if (err != -EPERM)
>> + retval = err;
> <<<<
> why EPERM is ok?
> do you want to miss some tasks?
A good question. This is how kill -1 is currently implemented.
It doesn't align with how signals are sent to a process group,
so it could very well be wrong.
>> + }
>> + return count ? retval : -ESRCH;
>> +}
>> +
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]