HomeFreeBSD

Only return EPERM from kill(-pid) when no process was signalled.

Description

Only return EPERM from kill(-pid) when no process was signalled.

As mandated by POSIX. Also clarify the kill(2) manpage.

While there, restructure the code in killpg1() to use helper which
keeps overall state of the process list iteration in the killpg1_ctx
structued, later used to infer the error returned.

Reported by: amdmi3
Reviewed by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D22621