setpgid non-compliance with POSIX?

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jun 30 09:45:54 GMT 2025


On Jun 28 12:32, Jeremy Drake via Cygwin wrote:
> I was looking at setpgid yesterday, and it seems deficient with respect to
> the errors required to be returned by the POSIX docs in
> https://pubs.opengroup.org/onlinepubs/9799919799/functions/setpgid.html
> 
> Basically, it seems that setpgid allows any arbitrary positive integer to
> be set as pgid, rather than restricting to setting it to either the
> process's pid or to an existing pgid in the same session (sid).

Yeah, error checking in setpgid is a bit on the lacking side.  With only
minor changes, the function is basically 25 years old :}

Off the top of my head I don't know how to check the pgid already exists.
Do you?


Corinna


More information about the Cygwin mailing list