From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E083F3858438; Tue, 28 Dec 2021 20:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E083F3858438 From: "crrodriguez at opensuse dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/28730] New: Extend posix_spawnattr_* interface with more useful features Date: Tue, 28 Dec 2021 20:24:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: crrodriguez at opensuse dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2021 20:24:41 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28730 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 contr= ol 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 exce= pt when you are spawning long running process or you are sure it will not do anything evil unsupervised by the calling process.=20 Therefore I propose a linux only extension (unless the hurd has it too?) wi= th prototype: posix_spawnattr_setpdeathsig_np(posix_spawnattr_t *attr, int deathsignal) that escentially calls=20 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 a= s=20 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 convenia= nce 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.. --=20 You are receiving this mail because: You are on the CC list for the bug.=