Added uid, euid, gid, egid, pid and ppid parameters to a live process.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 3 Sep 2006 06:04:25 +0000 (02:04 -0400)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 3 Sep 2006 06:04:25 +0000 (02:04 -0400)
--HG--
extra : convert_revision : 2101be8000bcdaf683730cfc079b4b78e34365d0

src/python/m5/objects/Process.py
src/sim/process.cc
src/sim/process.hh

index 0091d8654e7b824b2663d0634e17cfcc5bb4fee7..0b44aac8bfc7155f87b62e54a63a17f648636f13 100644 (file)
@@ -11,6 +11,12 @@ class LiveProcess(Process):
     cmd = VectorParam.String("command line (executable plus arguments)")
     env = VectorParam.String('', "environment settings")
     input = Param.String('cin', "filename for stdin")
+    uid = Param.Int(100, 'user id')
+    euid = Param.Int(100, 'effective user id')
+    gid = Param.Int(100, 'group id')
+    egid = Param.Int(100, 'effective group id')
+    pid = Param.Int(100, 'process id')
+    ppid = Param.Int(99, 'parent process id')
 
 class AlphaLiveProcess(LiveProcess):
     type = 'AlphaLiveProcess'
index 081a25976fd65edab06010ebf04dd778c81f0ec2..20f7fec2d0d053f8f721ab323b9966967dccf840 100644 (file)
@@ -460,6 +460,12 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LiveProcess)
     Param<string> output;
     VectorParam<string> env;
     SimObjectParam<System *> system;
+    Param<uint64_t> uid;
+    Param<uint64_t> euid;
+    Param<uint64_t> gid;
+    Param<uint64_t> egid;
+    Param<uint64_t> pid;
+    Param<uint64_t> ppid;
 
 END_DECLARE_SIM_OBJECT_PARAMS(LiveProcess)
 
@@ -471,7 +477,13 @@ 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(system, "system")
+    INIT_PARAM(system, "system"),
+    INIT_PARAM(uid, "user id"),
+    INIT_PARAM(euid, "effective user id"),
+    INIT_PARAM(gid, "group id"),
+    INIT_PARAM(egid, "effective group id"),
+    INIT_PARAM(pid, "process id"),
+    INIT_PARAM(ppid, "parent process id")
 
 END_INIT_SIM_OBJECT_PARAMS(LiveProcess)
 
index 763deb100d26ef3ddd90a22ea58c04394c0db12a..d64cc3cf11ec04b9f575ae164c167c541aeb08d2 100644 (file)
@@ -75,6 +75,16 @@ class Process : public SimObject
     // number of CPUs (esxec contexts, really) assigned to this process.
     unsigned int numCpus() { return threadContexts.size(); }
 
+    // Id of the owner of the process
+    uint64_t uid;
+    uint64_t euid;
+    uint64_t gid;
+    uint64_t egid;
+
+    // pid of the process and it's parent
+    uint64_t pid;
+    uint64_t ppid;
+
     // record of blocked context
     struct WaitRec
     {