From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F3F33858D1E; Tue, 18 Apr 2023 17:59:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F3F33858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681840760; bh=c3JaJ3zDji9+Ax1PNgulfy2r+imlTQV1PRx3rxHH8Vg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Zlkf2V0hvfCWb0AeijFgGcFEfJpYz9E7gkACMs6l3QxqLiYBajAMKfv4BTN0HN7FR 2fPP71zlwa998JCgOm5YaK/lYlkrRkMdkSH4H4kV/woW2CgAesKTF04ZuxQ7QCfGGK s4basaaqh/pohrj0LS2BugMu1r+/AZMByJ9zXIuw= From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/30349] Support returning a pidfd from posix_spawn() Date: Tue, 18 Apr 2023 17:59:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: adhemerval.zanella at linaro 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: Message-ID: In-Reply-To: References: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30349 --- Comment #7 from Adhemerval Zanella --- After discussion with other maintainers, it seems that it would be better n= ot to reuse the posix_spawn and posix_spawnp interface (with a new flag) and instead add different interfaces. Florian has raised the possible issue wi= th language bindings that might track the argument lifetime and mixing pid_t a= nd file descriptors might generate some problems in such scenarios. And since we already provide wrappers over the Linux pidfd syscall, Florian also suggested using the same name convention. The proposed interfaces are: extern int pidfd_spawn (int *__restrict __pid, const char *__restrict __path, const posix_spawn_file_actions_t *__restrict __fact= s, const posix_spawnattr_t *__restrict __attrp, char *const __argv[__restrict_arr], char *const __envp[__restrict_arr]) __nonnull ((2, 5)); extern int pidfd_spawnp (int *__restrict __pid, const char *__restrict __path, const posix_spawn_file_actions_t *__restrict __fac= ts, const posix_spawnattr_t *__restrict __attrp, char *const __argv[__restrict_arr], char *const __envp[__restrict_arr]) __nonnull ((2, 5)); I decided to reuse the posix_spawn attribute and file actions to avoid eith= er to rehash posix_spawn API or add a new one. This new API will be provided = by spawn.h. --=20 You are receiving this mail because: You are on the CC list for the bug.=