delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/06/30/15:07:56

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 55UJ7tBq2902396
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 55UJ7tBq2902396
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=xhT2kESW
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9E94385E00C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1751310473;
bh=Cx6pCGHS16ZtOaDsZAUlQBjGOnyarVJAohMmjhLca6I=;
h=Date:To:cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=xhT2kESWnMj3p6Wa21SFiZxMdNsR9D3TFGuSt9sGctPtnxBLgsOyyxZWiL1UdwSpV
JNlchMrqtibXKxCC0F/q2a9axvBeYmJ2o/8zHrIuE8hlN4xbUHv3na4AEqcYsykwmh
X8Ugyrdb47joGqK/5kioBfo39y9p5YGXTpRbpn0o=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D02543858431
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D02543858431
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751310445; cv=none;
b=x8WjNpMNGtf3WWL7NJMzOLN8wYoYE822X9t2wIwsE0bvUqh0xwt2a8hHut+V+6Yhfzp/dA/poSdKqZC1yvW14Oshe5Q4qDlrHwkIJvIrKmRlOzy8ANfYJu1dsZTPkDdw5b8dPQofReFPj7R8jPU2v3qAWslmqI8vaieAgYp1InM=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1751310445; c=relaxed/simple;
bh=Zt8EfZV9eC4a0wszxJj/4saPD7VW7jmKWurB+2iEZf0=;
h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;
b=RUu+fu5jXzjt6x793tlAva/O4mg+OWUn9DOswVpqFOfqYKhawHgEio3QaJxadjmdrxLtdlu7Me225+66tt04jZUtVRGFk2B+LF2oC7k4pTQrymlOtTzPVsxtjLVr4WivjxLvLpX71+tTEVHWDyhAp/eUWQM4QMzUv8RokQRIP+Y=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D02543858431
Date: Mon, 30 Jun 2025 12:07:25 -0700 (PDT)
X-X-Sender: jeremyd AT resin DOT csoft DOT net
To: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Subject: Re: setpgid non-compliance with POSIX?
In-Reply-To: <aGJc0nVQ-1v1DqCO@calimero.vinschen.de>
Message-ID: <f5748be6-5730-ae25-20af-3ed60be5c100@jdrake.com>
References: <3391453b-7914-a319-fad8-4729610558ea AT jdrake DOT com>
<aGJc0nVQ-1v1DqCO AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Jeremy Drake via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Jeremy Drake <cygwin AT jdrake DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Mon, 30 Jun 2025, Corinna Vinschen via Cygwin wrote:

> 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 :}

The POSIX docs metioned that an old BSD allowed setting arbitrary pgid

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

I think it'd have to iterate all processes and check pgid and sid members
of pinfo until it found a match.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019