Displaying 5 results from an estimated 5 matches for "have_execvpe".
2019 Nov 15
1
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
On 10/1/19 9:11 AM, Richard W.M. Jones wrote:
> On Tue, Oct 01, 2019 at 08:24:33AM -0500, Eric Blake wrote:
>>> +#else /* !HAVE_EXECVPE */
>>> + SET_NEXT_STATE (%.DEAD)
>>> + set_error (ENOTSUP, "platform does not support socket activation");
>>> + return 0;
>>> +#endif
>>
>> We probably ought to add a matching nbd_supports_socket_activation()
>> feature function.
&...
2019 Oct 01
2
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...sizeof (char *) * (nbd_internal_string_list_length (&env[i])));
> + i--;
> + }
> + }
Lots of O(N) traversals of the list, but this probably isn't our hot
spot, and so probably not worth optimizing further.
> +STATE_MACHINE {
> + CONNECT_SA.START:
> +#ifdef HAVE_EXECVPE
> + size_t len;
> + int s;
> + struct sockaddr_un addr;
> + char **env;
> + pid_t pid;
> + int flags;
> +
> + assert (!h->sock);
> + assert (h->argv);
> + assert (h->argv[0]);
> +
> + /* Use /tmp instead of TMPDIR because we must ensure the pat...
2019 Sep 30
4
[PATCH libnbd v2 0/2] Implement systemd socket activation.
v1 was posted here:
https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00337
v2:
- Drop the first patch.
- Hopefully fix the multiple issues with fork-safety and general
behaviour on error paths.
Note this requires execvpe for which there seems to be no equivalent
on FreeBSD, except some kind of tedious path parsing (but can we
assign to environ?)
Rich.
2019 Oct 01
0
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
On Tue, Oct 01, 2019 at 08:24:33AM -0500, Eric Blake wrote:
> >+#else /* !HAVE_EXECVPE */
> >+ SET_NEXT_STATE (%.DEAD)
> >+ set_error (ENOTSUP, "platform does not support socket activation");
> >+ return 0;
> >+#endif
>
> We probably ought to add a matching nbd_supports_socket_activation()
> feature function.
>
> Or, it would be p...
2019 Sep 30
0
[PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...sizeof (char *) * (nbd_internal_string_list_length (&env[i])));
+ i--;
+ }
+ }
+
+ return env;
+
+ err:
+ set_error (errno, "malloc");
+ nbd_internal_free_string_list (env);
+ free (p0);
+ free (p1);
+ return NULL;
+}
+
+STATE_MACHINE {
+ CONNECT_SA.START:
+#ifdef HAVE_EXECVPE
+ size_t len;
+ int s;
+ struct sockaddr_un addr;
+ char **env;
+ pid_t pid;
+ int flags;
+
+ assert (!h->sock);
+ assert (h->argv);
+ assert (h->argv[0]);
+
+ /* Use /tmp instead of TMPDIR because we must ensure the path is
+ * short enough to store in the sockaddr_un. On som...