blob: dd5c5121a97ba9cb04cce0359d279964353ae807 [file] [log] [blame]
Zachary Turner172d37d2014-10-14 21:55:08 +00001//===-- ProcessLauncherPosix.cpp --------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "lldb/Host/Host.h"
11#include "lldb/Host/HostProcess.h"
12#include "lldb/Host/posix/ProcessLauncherPosix.h"
13
14#include "lldb/Target/ProcessLaunchInfo.h"
15
16#include <limits.h>
17
18using namespace lldb;
19using namespace lldb_private;
20
21HostProcess
22ProcessLauncherPosix::LaunchProcess(const ProcessLaunchInfo &launch_info, Error &error)
23{
24 lldb::pid_t pid;
25 char exe_path[PATH_MAX];
26
27 launch_info.GetExecutableFile().GetPath(exe_path, sizeof(exe_path));
28
29 // TODO(zturner): Move the code from LaunchProcessPosixSpawn to here, and make MacOSX re-use this
30 // ProcessLauncher when it wants a posix_spawn launch.
31 error = Host::LaunchProcessPosixSpawn(exe_path, launch_info, pid);
32 return HostProcess(pid);
33}