process.hh (3311:7eb47a60dbd4) | process.hh (3669:3607aaed36b6) |
---|---|
1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 163 unchanged lines hidden (view full) --- 172// 173class ObjectFile; 174class LiveProcess : public Process 175{ 176 protected: 177 ObjectFile *objFile; 178 std::vector<std::string> argv; 179 std::vector<std::string> envp; | 1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 163 unchanged lines hidden (view full) --- 172// 173class ObjectFile; 174class LiveProcess : public Process 175{ 176 protected: 177 ObjectFile *objFile; 178 std::vector<std::string> argv; 179 std::vector<std::string> envp; |
180 std::string cwd; |
|
180 181 LiveProcess(const std::string &nm, ObjectFile *objFile, 182 System *_system, int stdin_fd, int stdout_fd, int stderr_fd, 183 std::vector<std::string> &argv, 184 std::vector<std::string> &envp, | 181 182 LiveProcess(const std::string &nm, ObjectFile *objFile, 183 System *_system, int stdin_fd, int stdout_fd, int stderr_fd, 184 std::vector<std::string> &argv, 185 std::vector<std::string> &envp, |
186 const std::string &cwd, |
|
185 uint64_t _uid, uint64_t _euid, 186 uint64_t _gid, uint64_t _egid, 187 uint64_t _pid, uint64_t _ppid); 188 189 virtual void argsInit(int intSize, int pageSize); 190 191 // Id of the owner of the process 192 uint64_t __uid; --- 9 unchanged lines hidden (view full) --- 202 203 inline uint64_t uid() {return __uid;} 204 inline uint64_t euid() {return __euid;} 205 inline uint64_t gid() {return __gid;} 206 inline uint64_t egid() {return __egid;} 207 inline uint64_t pid() {return __pid;} 208 inline uint64_t ppid() {return __ppid;} 209 | 187 uint64_t _uid, uint64_t _euid, 188 uint64_t _gid, uint64_t _egid, 189 uint64_t _pid, uint64_t _ppid); 190 191 virtual void argsInit(int intSize, int pageSize); 192 193 // Id of the owner of the process 194 uint64_t __uid; --- 9 unchanged lines hidden (view full) --- 204 205 inline uint64_t uid() {return __uid;} 206 inline uint64_t euid() {return __euid;} 207 inline uint64_t gid() {return __gid;} 208 inline uint64_t egid() {return __egid;} 209 inline uint64_t pid() {return __pid;} 210 inline uint64_t ppid() {return __ppid;} 211 |
212 std::string 213 fullPath(const std::string &filename) 214 { 215 if (filename[0] == '/' || cwd.empty()) 216 return filename; 217 218 std::string full = cwd; 219 220 if (cwd[cwd.size() - 1] != '/') 221 full += '/'; 222 223 return full + filename; 224 } 225 |
|
210 virtual void syscall(int64_t callnum, ThreadContext *tc); 211 212 virtual SyscallDesc* getDesc(int callnum) = 0; 213 214 // this function is used to create the LiveProcess object, since 215 // we can't tell which subclass of LiveProcess to use until we 216 // open and look at the object file. 217 static LiveProcess *create(const std::string &nm, 218 System *_system, 219 int stdin_fd, int stdout_fd, int stderr_fd, 220 std::string executable, 221 std::vector<std::string> &argv, 222 std::vector<std::string> &envp, | 226 virtual void syscall(int64_t callnum, ThreadContext *tc); 227 228 virtual SyscallDesc* getDesc(int callnum) = 0; 229 230 // this function is used to create the LiveProcess object, since 231 // we can't tell which subclass of LiveProcess to use until we 232 // open and look at the object file. 233 static LiveProcess *create(const std::string &nm, 234 System *_system, 235 int stdin_fd, int stdout_fd, int stderr_fd, 236 std::string executable, 237 std::vector<std::string> &argv, 238 std::vector<std::string> &envp, |
239 const std::string &cwd, |
|
223 uint64_t _uid, uint64_t _euid, 224 uint64_t _gid, uint64_t _egid, 225 uint64_t _pid, uint64_t _ppid); 226}; 227 228 229#endif // !FULL_SYSTEM 230 231#endif // __PROCESS_HH__ | 240 uint64_t _uid, uint64_t _euid, 241 uint64_t _gid, uint64_t _egid, 242 uint64_t _pid, uint64_t _ppid); 243}; 244 245 246#endif // !FULL_SYSTEM 247 248#endif // __PROCESS_HH__ |