42 #ifndef _DWMPROCESSINFO_HH_ 43 #define _DWMPROCESSINFO_HH_ 49 #include <sys/param.h> 50 #include <sys/sysctl.h> 54 #include <proc/readproc.h> 86 #if (defined(__FreeBSD__) || defined(__APPLE__)) 88 #elif (defined __OpenBSD__) 90 #elif (defined __linux__) 119 pid_t SessionId()
const;
164 const std::string &
Command()
const;
169 const std::vector<std::string> &
Args()
const;
179 uint32_t
Size()
const;
199 std::istream &
Read(std::istream & is);
204 std::ostream &
Write(std::ostream & os)
const;
210 int Read(gzFile gzf);
216 int Write(gzFile gzf)
const;
221 ssize_t
Read(
int fd);
226 ssize_t
Write(
int fd)
const;
231 size_t Read(FILE * f);
236 size_t Write(FILE *f)
const;
248 void AddArg(
const char *arg);
254 std::string _controllingTty;
256 pid_t _terminalSessionId;
257 uid_t _effectiveUserId;
259 uid_t _savedEffectiveUserId;
261 uid_t _savedEffectiveGroupId;
262 std::string _command;
265 uint32_t _residentSetSize;
267 std::vector<std::string> _args;
273 #endif // _DWMPROCESSINFO_HH_ Dwm::Rusage class definition.
pid_t Id() const
Returns the process ID.
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmGZWritable.hh:57
This class encapsulates a time value beyond the UNIX epoch, with microsecond granularity.
Definition: DwmTimeValue.hh:72
Dwm::Writable pure virtual class definition.
uint32_t ResidentSetSize() const
Returns the resident set size of the process (in bytes).
pid_t GroupId() const
Returns the process group ID.
Dwm::GZReadable pure virtual class definition.
Dwm::Readable pure virtual class definition.
This class encapsulates struct rusage and getrusage() functionality.
Definition: DwmRusage.hh:65
std::string EffectiveUserName() const
Returns the username of the effective user ID.
const std::string & ControllingTty() const
Returns the controlling tty name.
uint32_t StreamedLength() const
Returns the number of bytes that would be written if we called one of the Write() members...
std::string RealUserName() const
Returns the username of the real user ID.
uid_t RealUserId() const
Returns the real user ID.
uid_t RealGroupId() const
Returns the real process group ID.
Encapsulates information about a single process.
Definition: DwmProcessInfo.hh:73
const std::vector< std::string > & Args() const
Returns the argument list.
const std::string & Command() const
Returns the command.
Dwm::TimeValue class definition.
uid_t EffectiveUserId() const
Returns the effective user ID.
Definition: DwmBZ2IO.hh:67
This class is a pure virtual class, defining an interface for classes that can read their contents fr...
Definition: DwmGZReadable.hh:57
pid_t ParentId() const
Returns the parent process ID.
bool operator==(const ProcessInfo &process) const
operator ==
const TimeValue & StartTime() const
Returns the proces start time.
This class defines an interface for classes that can write their contents to an ostream, file descriptor or FILE pointer.
Definition: DwmWritable.hh:58
Dwm::GZWritable pure virtual class definition.
uid_t SavedEffectiveUserId() const
Returns the saved effective user ID.
This class defines an interface for classes that can read their contents from an istream, file descriptor or FILE pointer.
Definition: DwmReadable.hh:58
std::string SavedEffectiveUserName() const
Returns the username of the saved effective user ID.
uid_t SavedEffectiveGroupId() const
Returns the saved effective group ID.
const Dwm::Rusage & Rusage() const
Returns the process rusage.
std::ostream & Write(std::ostream &os) const
Writes to an ostream. Returns the ostream.
uint32_t Size() const
Returns the virtual size of the process (in bytes).
std::istream & Read(std::istream &is)
Reads from an istream. Returns the istream.
void AddArg(const char *arg)
Adds an argument to the list of args.