public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28730] New: Extend posix_spawnattr_* interface with more useful features
@ 2021-12-28 20:24 crrodriguez at opensuse dot org
  2021-12-28 20:47 ` [Bug libc/28730] " crrodriguez at opensuse dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: crrodriguez at opensuse dot org @ 2021-12-28 20:24 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28730

            Bug ID: 28730
           Summary: Extend posix_spawnattr_* interface with more useful
                    features
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: crrodriguez at opensuse dot org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

I have reviewed a number of software to possible make them use posix_spawn
interfaces and found a few missing features, (other than the terminal control
stuff whicb I am aware it is being worked on) I do not expect all of this
suggestions to be implemented and I know it is not intended as a 100%
fork/execve replacement

The first one .. if I:

posix_spawn(&child_pid, "/bin/sleep" , NULL, NULL, (char *const[]) { "sleep",
"1000", NULL}, environ)

and kill the process the invoked the function, the orphan keeps running as good
ole unix behaviour mandates, but this behaviour is highly undersirable except
when you are spawning long running process or you are sure it will not do
anything evil unsupervised by the calling process. 

Therefore I propose a linux only extension (unless the hurd has it too?) with
prototype:

posix_spawnattr_setpdeathsig_np(posix_spawnattr_t *attr, int deathsignal)

that escentially calls 

prctl(PR_SET_PDEATHSIG, deathsignal);

in the "child" process.

Unless standards say otherwise, there shall be no default death signal
configured.


Second feature request will be having an equivalent to pthread_setname_np as 
posix_spawnattr_setname_np which does the same as pthread_setname_np but on
this case for the "child" process..

Unless the standards say otherwise there shall be no default name set, but it
will be nice if glibc tags its own created processes with for example a
(system), (popen), (wordexp) name, but this is just a nice to have conveniance
for humans that are looking the process table..


Third is a way to set the "child" rlimit, like
posix_spawnattr_setrlimit_np(posix_spawnattr_t *attr, int resource, struct
rlimit *rlim)

parent may be running with a high RLIMIT_NOFILE but execute a program that uses
select() and things will end badly when RLIMIT_NOFILE > FD_SETSIZE.

I could try to implement this but Im not sure how I should exactly extend
posix_spawnattr_t in a binary compatible way..

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-10 18:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 20:24 [Bug libc/28730] New: Extend posix_spawnattr_* interface with more useful features crrodriguez at opensuse dot org
2021-12-28 20:47 ` [Bug libc/28730] " crrodriguez at opensuse dot org
2022-01-06 14:22 ` adhemerval.zanella at linaro dot org
2022-01-06 21:47 ` crrodriguez at opensuse dot org
2022-01-07 12:17 ` adhemerval.zanella at linaro dot org
2022-01-09 14:07 ` crrodriguez at opensuse dot org
2022-01-10 14:54 ` adhemerval.zanella at linaro dot org
2022-01-10 15:12 ` fweimer at redhat dot com
2022-01-10 17:17 ` crrodriguez at opensuse dot org
2022-01-10 18:34 ` adhemerval.zanella at linaro dot org

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).