blob: e6e1f99ca009538dabd644132c23d489e4344682 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library process;
using io;
using ldsvc;
struct HandleInfo {
// The handle to use for this argument.
handle @handle;
// Process argument identifier, from <zircon/processargs.h>.
uint32 id;
};
struct NameInfo {
// Path at which to install the associated directory.
//
// Must be an absolute path (i.e., start with '/').
string path;
// The associated directory.
io.Directory directory;
};
struct LaunchInfo {
// The executable to run in the process.
handle<vmo> executable;
// The job in which to create the process.
handle<job> job;
// The shared library loader to use for the process.
ldsvc.Loader loader;
};
struct LaunchResult {
// A status code describing the failure.
status @status;
// A string describing the failure.
//
// Non-null when |status| is an error.
string? error_message;
// The process that was launched.
//
// Present when |status| is ZX_OK.
handle<process>? process;
// The vmar object that was created when the process was created.
//
// See <https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls/process_create.md>.
//
// Present when |status| is ZX_OK.
handle<vmar>? root_vmar;
};
interface Launcher {
// Creates and starts the process described by |info|.
1: Launch(LaunchInfo info) -> (LaunchResult result);
// The arguments to pass to the process.
2: AddArgs(vector<string> args);
// The environment variables to use for the process.
3: AddEnvirons(vector<string> environ);
// The namespace to install in the process.
//
// The paths in the namespace must be non-overlapping. See
// <https://fuchsia.googlesource.com/docs/+/master/the-book/namespaces.md> for details.
4: AddNames(vector<NameInfo> names);
// Additional startup handles to pass to the process.
5: AddHandles(vector<HandleInfo> handles);
};