[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: Felt and understood. The plethora of things to do between (v)fork+exec really makes me wish for a "little" eBPF interpreter rather than needing so much specific plumbing. But that'd have the same problem as preexec_fn: in absence of something that

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Sun, Dec 27, 2020, at 14:53, Gregory P. Smith wrote: > Most prctl uses I noticed were PDEATHSIG but I'd need to explicitly > audit those. Users don't seem to care about it's documented main > thread caveat (which matches what I've seen; most programs

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-27 Thread STINNER Victor
STINNER Victor added the comment: I agree that it would be nice to pack these parameters, similar to the Windows STARTUPINFO. The subprocess.Popen constructor has more and more parameter for functions executed between fork and exec: def __init__(self, args, bufsize=-1, executable=None,

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the golang SysProcAttr reference. The internals of _posixsubprocess have already becoming unwieldy with the abundance of args. Such a struct/object would also fit in well there and avoid excessive C stack use. (as izbyshev noted during the

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-26 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- nosy: +izbyshev ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-25 Thread Benjamin Peterson
Benjamin Peterson added the comment: I wonder if a dedicated datatype should be created for all os-specific parameters like https://golang.org/pkg/syscall/#SysProcAttr. Popen already has way too many parameters. And prctl is a very general interface; probably 98% of prctls would never need

[issue42736] Add support for making Linux prctl(...) calls to subprocess

2020-12-24 Thread Gregory P. Smith
New submission from Gregory P. Smith : Another use of `subprocess preexec_fn=` that I've come across has been to call Linux's `prctl` in the child process before the `exec`. `_libc.prctl(_PR_SET_PDEATHSIG, value)` for example. Adding a linux_prctl_calls= parameter listing information about