supporting terminal ownership assignment (tcsetpgrp()) in posix_spawn

Florian Weimer fweimer@redhat.com
Wed Jun 9 06:41:15 GMT 2021


* Godmar Back via Libc-help:

> I haven't checked how the current implementation works. Do you use a
> pipe or something for the child to report back if something went
> wrong, or does the parent somehow check if the asked-for actions in
> the child will likely succeed?  If the former, doing setsid first, and
> then, if given, doing the tcsetpgrp call will fail as you say and this
> failure would be reported back to the caller. Then they know they've
> misused the API.

It's the first.  We use shared memory (the side effect of vfork) to
communicate errno to the original process.

Thanks,
Florian



More information about the Libc-help mailing list