/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Create a socketpair with both ends marked as close-on-exec static Result<Ok, LaunchError> CreateSocketPair(UniqueFileHandle& aFD0,
UniqueFileHandle& aFD1) { int fds[2]; #ifdef SOCK_CLOEXEC
constexpr int type = SOCK_STREAM | SOCK_CLOEXEC; #else
constexpr int type = SOCK_STREAM; #endif
IPC::MessageWriter writer(msg); #ifdefined(XP_LINUX) && defined(MOZ_SANDBOX)
WriteParam(&writer, aOptions.fork_flags);
WriteParam(&writer, std::move(aOptions.sandbox_chroot_server)); #endif
WriteIPDLParam(&writer, nullptr, std::move(execChild)); if (!mTcver->Send(msg)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("the pipe to the fork server is closed or having errors"));
OnError(); return Err(LaunchError("FSC::SFNS::Send"));
}
}
{
MiniTransceiver execTcver(execParent.get());
IPC::Message execMsg(MSG_ROUTING_CONTROL, Msg_SubprocessExecInfo__ID);
IPC::MessageWriter execWriter(execMsg);
WriteParam(&execWriter, aOptions.env_map);
WriteParam(&execWriter, aArgs.mArgs);
WriteParam(&execWriter, std::move(aArgs.mFiles)); if (!execTcver.Send(execMsg)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("failed to send exec info to the fork server"));
OnError(); return Err(LaunchError("FSC::SFNS::Send2"));
}
}
execParent = nullptr;
UniquePtr<IPC::Message> reply; if (!mTcver->Recv(reply)) {
MOZ_LOG(gForkServiceLog, LogLevel::Verbose,
("the pipe to the fork server is closed or having errors"));
OnError(); return Err(LaunchError("FSC::SFNS::Recv"));
}
OnMessageReceived(std::move(reply));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.