From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id D3E9D3870866 for ; Thu, 3 Jun 2021 13:58:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3E9D3870866 Received: by mail-lf1-x135.google.com with SMTP id v22so7613205lfa.3 for ; Thu, 03 Jun 2021 06:58:19 -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:from:date:message-id:subject:to; bh=Ir86N06PWo2SpZp+q/J0K5UhZ3gURy1yVae1rO+PcTY=; b=kyGJ4sOgHH0g2WFQOmvNoF9Te+M9SHSe3On/pr5p1Z0eOBaLzCAVk9cWz64r2D5oq8 M0TgVqJ9OlegNE+wXwShRI2JbU+iMeuxkExaj6ZBd37pG3hDvbT1/j+St+OvQF8JMi68 PwwlNpxhGmtYt4kIZBZyytkkXiQuwGzkPrrnPTU6nsIxFHyj7HGcNyuDbK4uRDF706Pq j1SoT5atr4xRGmIGkKc6tg4y9+R6tVfyfP9f4SWtysRi6GgQtLRaSOj+vBMZbITLaCCT qqZ+LMRrvA7rUF3H1GrmR69hB2ONBui9qLPiQRKs1IuUUFc4KqB+thFuTQq0G6gzygI1 96Ig== X-Gm-Message-State: AOAM531Mu3NPlYupReT2X604rkcUlWK9hXhcS9GA0FvtUUyTd3J+v/K/ DjxWhNuuClc3+02DWOwMohMKeo/IbAuq8Mw0RVFwC7eTYg7TNg== X-Google-Smtp-Source: ABdhPJzRHgQLa3fkG0tMAiUtzffmACu73eLf+xaNC6v7QDEi8ruYdclp8K3DP+jcAQdLO7JQs4s+LbKE9PA1ZGKxQ+4= X-Received: by 2002:a05:6512:228b:: with SMTP id f11mr26456831lfu.496.1622728698179; Thu, 03 Jun 2021 06:58:18 -0700 (PDT) MIME-Version: 1.0 From: Godmar Back Date: Thu, 3 Jun 2021 09:58:06 -0400 Message-ID: Subject: supporting terminal ownership assignment (tcsetpgrp()) in posix_spawn To: William Tambe via Libc-help X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, KAM_SHORT, 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: Thu, 03 Jun 2021 13:58:30 -0000 I've recently been playing with posix_spawn() and noticed that it lacks support for assigning terminal ownership (as would be done via tcsetpgrp()). As a consequence, it cannot be used for job control shells when starting jobs in the foreground [1]. IBM's implementation of spawn [2] for zOS supports SPAWN_SETTCPGRP for this reason. Even though the POSIX spec states "Future Directions: None" I came across this Austin group issue [3] which proposes to add a way to set the child process's session id, and which appears to have been accepted in 2016. This is an example of evolution of posix_spawn. Is anyone aware of efforts to add something similar to POSIX, and more specifically, to Linux? If the current implementation of posix_spawn is library based (I'm guessing it is) then there would be nothing to prevent Linux from adding additional flags, just like QNX or Blackberry have already done ([3]). - Godmar [1] https://github.com/fish-shell/fish-shell/commit/5e371e8fe7cbdecd87678d50d06c12851213776e [2] https://www.ibm.com/docs/en/zos/2.2.0?topic=functions-spawn-spawnp-spawn-new-process [3] https://www.austingroupbugs.net/view.php?id=1044