public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [glibc] posix: Add terminal control setting support for posix_spawn
Date: Thu, 27 Jan 2022 12:57:49 +0100	[thread overview]
Message-ID: <87bkzxo0g2.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <a1d4308c-54e8-187d-e6ad-d67b6d2122ad@linaro.org> (Adhemerval Zanella's message of "Thu, 27 Jan 2022 08:38:58 -0300")

* Adhemerval Zanella:

> I did not considered the closefrom in conjunction with closefrom file
> action and making a file action does make sense indeed.  Maybe a better
> approach would be to remove posix_spawnattr_tcsetpgrp_np and
> posix_spawnattr_tcsetpgrp_np and add:
>
>   int posix_spawn_file_actions_tcsetgrp_np (posix_spawn_file_actions_t *,
> 					    int fd);
>
> Similar to posix_spawn_file_actions_addfchdir_np.
>
> So to create a process and set the controlling terminal, one can use the
> following sequence:
>
>   int tcfd = open (_PATH_TTY, O_RDONLY, 0600);
>
>   posix_spawnattr_t attr;
>   posix_spawnattr_init (&attr);
>   posix_spawnattr_setflags (&attr, POSIX_SPAWN_TCSETPGROUP);

Why is POSIX_SPAWN_TCSETPGROUP needed?

>   posix_spawn_file_actions_t actions;
>   posix_spawn_file_actions_init (&actions);
>   posix_spawn_file_actions_tcsetgrp_np (&actions, tcfd);
>
> So users would be able to add a posix_spawn_file_actions_addclose or
> posix_spawn_file_actions_addclosefrom_np. 

This would address my concern, yes.

Thanks,
Florian


  reply	other threads:[~2022-01-27 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220125180124.B88AC3857C70@sourceware.org>
2022-01-27 10:49 ` Florian Weimer
2022-01-27 11:38   ` Adhemerval Zanella
2022-01-27 11:57     ` Florian Weimer [this message]
2022-01-27 12:02       ` Adhemerval Zanella
2022-01-27 12:15         ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bkzxo0g2.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).