L4Re/departure

libexec/include/exec/process_creator_resource.h

700:ab0cc68bfcaf
5 months ago Paul Boddie Added support for an error stream when creating processes. libc_newlib
     1 /*     2  * Support for executing code in new tasks and threads.     3  *     4  * Copyright (C) 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>     5  *     6  * This program is free software; you can redistribute it and/or     7  * modify it under the terms of the GNU General Public License as     8  * published by the Free Software Foundation; either version 2 of     9  * the License, or (at your option) any later version.    10  *    11  * This program is distributed in the hope that it will be useful,    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    14  * GNU General Public License for more details.    15  *    16  * You should have received a copy of the GNU General Public License    17  * along with this program; if not, write to the Free Software    18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,    19  * Boston, MA  02110-1301, USA    20  */    21     22 #pragma once    23     24 #include <exec/process_creating.h>    25 #include <resource/resource.h>    26     27 #include "opener_interface.h"    28     29     30     31 /* Process creator. */    32     33 class ProcessCreatorResource : public Opener, public Resource    34 {    35 protected:    36   ProcessCreating _creating;    37     38 public:    39   explicit ProcessCreatorResource(const char *rm_filename, file_t *rm_file);    40     41   virtual ~ProcessCreatorResource();    42     43   /* Server details. */    44     45   ipc_server_default_config_type config();    46     47   void *interface()    48   { return static_cast<Opener *>(this); }    49     50   /* Local operations. */    51     52   virtual long init_process(l4_cap_idx_t *process);    53     54   virtual long start(int argc, const char *argv[], l4_cap_idx_t reader,    55                      l4_cap_idx_t writer, l4_cap_idx_t error,    56                      l4_cap_idx_t process);    57     58   /* Opener interface methods. */    59     60   virtual long context(l4_cap_idx_t *context);    61 };    62     63 /* vim: tabstop=2 expandtab shiftwidth=2    64 */