summaryrefslogtreecommitdiff
path: root/src/sim/process.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-22 15:45:32 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-22 15:45:32 -0500
commit0a99750ebfe9a9b400ee5f0610ed429851345c4b (patch)
treeb73463f5330730cca540b0fb0bd3757353e88d1a /src/sim/process.cc
parent04e6a3a07b6fdaba9f0954971b61556078611a55 (diff)
parent719416b60ff2ab60403d22b6c7f75139b9535d8c (diff)
downloadgem5-0a99750ebfe9a9b400ee5f0610ed429851345c4b.tar.xz
Merge zizzer:/bk/sparcfs
into zower.eecs.umich.edu:/eecshome/m5/newmem --HG-- extra : convert_revision : 75f3398e38e18eb1f8248e23708d7a8d8cce0fc5
Diffstat (limited to 'src/sim/process.cc')
-rw-r--r--src/sim/process.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc
index f3e289d41..b43fa7d00 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -314,11 +314,12 @@ LiveProcess::LiveProcess(const string &nm, ObjectFile *_objFile,
System *_system,
int stdin_fd, int stdout_fd, int stderr_fd,
vector<string> &_argv, vector<string> &_envp,
+ const string &_cwd,
uint64_t _uid, uint64_t _euid,
uint64_t _gid, uint64_t _egid,
uint64_t _pid, uint64_t _ppid)
: Process(nm, _system, stdin_fd, stdout_fd, stderr_fd),
- objFile(_objFile), argv(_argv), envp(_envp)
+ objFile(_objFile), argv(_argv), envp(_envp), cwd(_cwd)
{
__uid = _uid;
__euid = _euid;
@@ -427,6 +428,7 @@ LiveProcess::create(const std::string &nm, System *system, int stdin_fd,
int stdout_fd, int stderr_fd, std::string executable,
std::vector<std::string> &argv,
std::vector<std::string> &envp,
+ const std::string &cwd,
uint64_t _uid, uint64_t _euid,
uint64_t _gid, uint64_t _egid,
uint64_t _pid, uint64_t _ppid)
@@ -445,14 +447,14 @@ LiveProcess::create(const std::string &nm, System *system, int stdin_fd,
case ObjectFile::Tru64:
process = new AlphaTru64Process(nm, objFile, system,
stdin_fd, stdout_fd, stderr_fd,
- argv, envp,
+ argv, envp, cwd,
_uid, _euid, _gid, _egid, _pid, _ppid);
break;
case ObjectFile::Linux:
process = new AlphaLinuxProcess(nm, objFile, system,
stdin_fd, stdout_fd, stderr_fd,
- argv, envp,
+ argv, envp, cwd,
_uid, _euid, _gid, _egid, _pid, _ppid);
break;
@@ -466,7 +468,7 @@ LiveProcess::create(const std::string &nm, System *system, int stdin_fd,
case ObjectFile::Linux:
process = new SparcLinuxProcess(nm, objFile, system,
stdin_fd, stdout_fd, stderr_fd,
- argv, envp,
+ argv, envp, cwd,
_uid, _euid, _gid, _egid, _pid, _ppid);
break;
@@ -474,7 +476,7 @@ LiveProcess::create(const std::string &nm, System *system, int stdin_fd,
case ObjectFile::Solaris:
process = new SparcSolarisProcess(nm, objFile, system,
stdin_fd, stdout_fd, stderr_fd,
- argv, envp,
+ argv, envp, cwd,
_uid, _euid, _gid, _egid, _pid, _ppid);
break;
default:
@@ -487,7 +489,7 @@ LiveProcess::create(const std::string &nm, System *system, int stdin_fd,
case ObjectFile::Linux:
process = new MipsLinuxProcess(nm, objFile, system,
stdin_fd, stdout_fd, stderr_fd,
- argv, envp,
+ argv, envp, cwd,
_uid, _euid, _gid, _egid, _pid, _ppid);
break;
@@ -512,6 +514,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LiveProcess)
Param<string> input;
Param<string> output;
VectorParam<string> env;
+ Param<string> cwd;
SimObjectParam<System *> system;
Param<uint64_t> uid;
Param<uint64_t> euid;
@@ -530,6 +533,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(LiveProcess)
INIT_PARAM(input, "filename for stdin (dflt: use sim stdin)"),
INIT_PARAM(output, "filename for stdout/stderr (dflt: use sim stdout)"),
INIT_PARAM(env, "environment settings"),
+ INIT_PARAM(cwd, "current working directory"),
INIT_PARAM(system, "system"),
INIT_PARAM(uid, "user id"),
INIT_PARAM(euid, "effective user id"),
@@ -566,7 +570,7 @@ CREATE_SIM_OBJECT(LiveProcess)
return LiveProcess::create(getInstanceName(), system,
stdin_fd, stdout_fd, stderr_fd,
(string)executable == "" ? cmd[0] : executable,
- cmd, env,
+ cmd, env, cwd,
uid, euid, gid, egid, pid, ppid);
}