From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 986143857831 for ; Fri, 11 Jun 2021 23:58:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 986143857831 Received: by mail-lf1-x12b.google.com with SMTP id a1so10927945lfr.12 for ; Fri, 11 Jun 2021 16:58:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4BfX4vFYp4Dwfont0aYZtuOrjRtFLW4C/FtYRveqYy8=; b=Yc4/SQF3rRw5oz5Ul8pi59qWaYCfVZ0q3zfHdx2f4Z7pJgQpzZNq87emr8QOhKl8Dy ddVx4rIVQJ7HJ9cKj2Lcw5AAYbzz91UBr+emdHT1AFEuF2GMaqXc8yeu462K6XFt+ErG 8VXjb3erugGkVi3k18Y1WJGPwnap3XBX6cp/xGlVpcwIYxpoyQaI0I92vjpV8t5lihUE +SNQBwyj1ShZZqEOIMzAZnXKa/u5ZNFm26F5ETY25erAxZUULrcPJ1TFScB7kbuPMsUv vundQNJgoOB4sxcAjiZr290AWczWCmg5ApWTn6cbPKGOtYMd5Dv7lagGCDhJg6nAQ7E3 oWlw== X-Gm-Message-State: AOAM531sxf4HN56jOIoH9CHWCRm+vk46FX7Iu0BAO8hy9Ahzctw6lBCC dEGLF4scn9GaONfteM6u0ZXVbOcju8wexuJzeEw= X-Google-Smtp-Source: ABdhPJzrRxX4a/1h8TXsLcKwCD/YBsHmKkfHdMGhd5uu4zQb2xETSGU8ycBEgn2Qwv/lYfA9v6ivGG1Zi9U/ri22aVU= X-Received: by 2002:a19:f11e:: with SMTP id p30mr4324736lfh.496.1623455917385; Fri, 11 Jun 2021 16:58:37 -0700 (PDT) MIME-Version: 1.0 References: <7298cb72-becb-80bb-b2df-d97bdb201e95@linaro.org> <11145e53-3fbc-0f04-33f8-b2d9981f0ea8@linaro.org> <4429f842-e9c7-b907-3374-6b48c6fc089e@linaro.org> In-Reply-To: From: Godmar Back Date: Fri, 11 Jun 2021 19:58:26 -0400 Message-ID: Subject: Re: supporting terminal ownership assignment (tcsetpgrp()) in posix_spawn To: Adhemerval Zanella Cc: Libc-help X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2021 23:58:40 -0000 On Fri, Jun 11, 2021 at 9:45 AM Adhemerval Zanella < adhemerval.zanella@linaro.org> wrote: > > So maybe this following: > > int posix_spawnattr_tcsetpgrp_np (posix_spawnattr_t *__attr, int fd); > > Similar to tcgetpgrp, it make the process group of the created process > the > foreground process group on the terminal associated to FD. It is similar > to tcsetpgrp(), where FD must be controlling terminal of the calling > process, > and still be associated with its session. > > It can be used along with POSIX_SPAWN_SETPGROUP to make the created > process > a new group leader to be used as the process group. > > As I stated before, that would be fine, and the caller in most cases will likely already have an open file descriptor referring to their controlling terminal.