summaryrefslogtreecommitdiff
path: root/src/sim/process.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-09-17 03:00:55 -0400
committerGabe Black <gblack@eecs.umich.edu>2006-09-17 03:00:55 -0400
commit30b87e90f8e3f6ffa16026f7776c6609fe3ada24 (patch)
treeb5e9cd853ea76982e5cb2e83e024592c3dc3886a /src/sim/process.cc
parente4fcef58518840c8191c468aff6d314175d68e21 (diff)
downloadgem5-30b87e90f8e3f6ffa16026f7776c6609fe3ada24.tar.xz
Finished changing how stat structures are translated, fixed the handling of various ids as LiveProcess parameters.
src/arch/alpha/linux/process.cc: src/arch/alpha/linux/process.hh: src/arch/alpha/process.cc: src/arch/alpha/process.hh: src/arch/alpha/tru64/process.cc: src/arch/alpha/tru64/process.hh: src/arch/mips/linux/process.cc: src/arch/mips/linux/process.hh: src/arch/mips/process.cc: src/arch/mips/process.hh: src/arch/sparc/linux/process.cc: src/arch/sparc/linux/process.hh: src/arch/sparc/process.cc: src/arch/sparc/process.hh: src/arch/sparc/solaris/process.cc: src/arch/sparc/solaris/process.hh: src/sim/process.cc: src/sim/process.hh: src/sim/syscall_emul.cc: src/sim/syscall_emul.hh: Changed Process to LiveProcess in syscall handlers and fixed the implementation of uid, euid, gid, egid, pid and ppid as LiveProcess parameters. src/kern/tru64/tru64.hh: Changed Process to LiveProcess in syscall handlers and fixed the implementation of uid, euid, gid, egid, pid and ppid as LiveProcess parameters. Also fit tru64 in with the new way to handle stat calls. --HG-- extra : convert_revision : 0198b838e5c09a730065dc6f018738145bc96269
Diffstat (limited to 'src/sim/process.cc')
-rw-r--r--src/sim/process.cc35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc
index 20f7fec2d..46ccd2596 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -278,10 +278,20 @@ copyStringArray(vector<string> &strings, Addr array_ptr, Addr data_ptr,
LiveProcess::LiveProcess(const string &nm, ObjectFile *_objFile,
System *_system,
int stdin_fd, int stdout_fd, int stderr_fd,
- vector<string> &_argv, vector<string> &_envp)
+ vector<string> &_argv, vector<string> &_envp,
+ 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)
{
+ __uid = _uid;
+ __euid = _euid;
+ __gid = _gid;
+ __egid = _egid;
+ __pid = _pid;
+ __ppid = _ppid;
+
prog_fname = argv[0];
// load up symbols, if any... these may be used for debugging or
@@ -381,7 +391,10 @@ LiveProcess *
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)
+ std::vector<std::string> &envp,
+ uint64_t _uid, uint64_t _euid,
+ uint64_t _gid, uint64_t _egid,
+ uint64_t _pid, uint64_t _ppid)
{
LiveProcess *process = NULL;
@@ -397,13 +410,15 @@ 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,
+ _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,
+ _uid, _euid, _gid, _egid, _pid, _ppid);
break;
default:
@@ -416,14 +431,16 @@ 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,
+ _uid, _euid, _gid, _egid, _pid, _ppid);
break;
case ObjectFile::Solaris:
process = new SparcSolarisProcess(nm, objFile, system,
stdin_fd, stdout_fd, stderr_fd,
- argv, envp);
+ argv, envp,
+ _uid, _euid, _gid, _egid, _pid, _ppid);
break;
default:
fatal("Unknown/unsupported operating system.");
@@ -435,7 +452,8 @@ 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,
+ _uid, _euid, _gid, _egid, _pid, _ppid);
break;
default:
@@ -513,7 +531,8 @@ CREATE_SIM_OBJECT(LiveProcess)
return LiveProcess::create(getInstanceName(), system,
stdin_fd, stdout_fd, stderr_fd,
(string)executable == "" ? cmd[0] : executable,
- cmd, env);
+ cmd, env,
+ uid, euid, gid, egid, pid, ppid);
}