1.1 --- a/libfsclient/lib/src/process.cc Mon Dec 11 19:17:25 2023 +0100
1.2 +++ b/libfsclient/lib/src/process.cc Mon Dec 11 19:23:39 2023 +0100
1.3 @@ -111,22 +111,24 @@
1.4
1.5 /* A convenience function for creating and starting a process. */
1.6
1.7 -long process_spawn(int argc, const char *argv[], process_t **process)
1.8 +long process_spawn(int argc, const char *argv[], file_t *writer,
1.9 + process_t **process)
1.10 {
1.11 *process = process_new();
1.12
1.13 /* Start the process with the given arguments. */
1.14
1.15 if (*process != NULL)
1.16 - return process_start(*process, argc, argv);
1.17 + return process_start(*process, argc, argv, writer);
1.18 else
1.19 return -L4_ENOMEM;
1.20 }
1.21
1.22 /* Start a process using the given arguments.
1.23 - NOTE: This does not yet obtain input/output pipes. */
1.24 + NOTE: This does not yet employ a pipe for the process's input stream. */
1.25
1.26 -long process_start(process_t *process, int argc, const char *argv[])
1.27 +long process_start(process_t *process, int argc, const char *argv[],
1.28 + file_t *writer)
1.29 {
1.30 l4_cap_idx_t server = l4re_env_get_cap(ENV_PROCESS_SERVER_NAME);
1.31
1.32 @@ -157,7 +159,8 @@
1.33
1.34 /* Start the process, obtaining a reference to it. */
1.35
1.36 - err = creator.start(argc, &process->ref);
1.37 + err = creator.start(argc, writer != NULL ? writer->ref : (l4_cap_idx_t) L4_INVALID_CAP,
1.38 + &process->ref);
1.39
1.40 /* Initialise the notifiable section of the structure. */
1.41