From: Godmar Back <godmar@gmail.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Libc-help <libc-help@sourceware.org>
Subject: Re: supporting terminal ownership assignment (tcsetpgrp()) in posix_spawn
Date: Mon, 7 Jun 2021 19:57:17 -0400 [thread overview]
Message-ID: <CAB4+JYK9cfPRHOtDetNTHAkiiZqXr9n_Fc8GdGiGnSQr=+UfKA@mail.gmail.com> (raw)
In-Reply-To: <cad74bcf-feea-ffa1-3999-1d486dbd9e08@linaro.org>
On Mon, Jun 7, 2021 at 5:36 PM Adhemerval Zanella <
adhemerval.zanella@linaro.org> wrote:
>
> Yeah I forgot the inherent race condition on this scheme. I think it
> should be possible to add such interface as a posix_spawn file action:
>
> int posix_spawn_file_actions_tcsetpgrp_np (int fd)
>
> Not sure if it make sense to support a pid different than the created
> helper process (which will eventually call execve) since it is something
> the parent can do it itself.
>
>
The Blackberry implementation [1] has a single flag, with no arguments. It
doesn't pass a file descriptor. It appears undocumented, but I would guess
that this means that the child's process group becomes the foreground
process group of the controlling terminal, which in a kernel implementation
may be directly accessible. In a library implementation, it would require
obtaining a file descriptor, perhaps via `ctermid`, which would introduce
another error situation that would need to be handled.
I think either approach (flag or file action) would be fine; in the
envisioned use case, it's likely that the caller already has an open file
descriptor available that refers to the intended terminal.
Incidentally, I also sent an email to the mailing list of the Austin group,
though haven't received any replies.
- Godmar
[1]
https://developer.blackberry.com/native/reference/core/com.qnx.doc.neutrino.lib_ref/topic/p/posix_spawnattr_setxflags.html
next prev parent reply other threads:[~2021-06-07 23:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 13:58 Godmar Back
2021-06-07 21:04 ` Adhemerval Zanella
2021-06-07 21:23 ` Godmar Back
2021-06-07 21:36 ` Adhemerval Zanella
2021-06-07 23:57 ` Godmar Back [this message]
2021-06-08 13:50 ` Adhemerval Zanella
2021-06-08 14:37 ` Godmar Back
2021-06-08 16:42 ` Adhemerval Zanella
2021-06-08 22:11 ` Godmar Back
2021-06-09 6:41 ` Florian Weimer
2021-06-09 12:00 ` Adhemerval Zanella
2021-06-09 13:12 ` Godmar Back
2021-06-11 13:45 ` Adhemerval Zanella
2021-06-11 23:58 ` Godmar Back
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='CAB4+JYK9cfPRHOtDetNTHAkiiZqXr9n_Fc8GdGiGnSQr=+UfKA@mail.gmail.com' \
--to=godmar@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-help@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).