The Pedigree Project  0.1
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
PosixProcess Class Reference
+ Inheritance diagram for PosixProcess:
+ Collaboration diagram for PosixProcess:

Classes

struct  RobustListData
 

Public Types

enum  Membership { Leader = 0, Member, NoGroup }
 
- Public Types inherited from Process
enum  ProcessType { Stock, Posix }
 
enum  ProcessState {
  Active, Suspended, Terminating, Terminated,
  Reaped
}
 

Public Member Functions

 PosixProcess (Process *pParent, bool bCopyOnWrite=true)
 
void setProcessGroup (ProcessGroup *newGroup, bool bRemoveFromGroup=true)
 
ProcessGroupgetProcessGroup () const
 
void setGroupMembership (Membership type)
 
Membership getGroupMembership () const
 
PosixSessiongetSession () const
 
void setSession (PosixSession *p)
 
virtual ProcessType getType ()
 
void setMask (uint32_t mask)
 
uint32_t getMask () const
 
const RobustListDatagetRobustList () const
 
void setRobustList (const RobustListData &data)
 
IntervalTimergetRealIntervalTimer ()
 
IntervalTimergetVirtualIntervalTimer ()
 
IntervalTimergetProfileIntervalTimer ()
 
virtual int64_t getUserId () const
 
virtual int64_t getGroupId () const
 
virtual int64_t getEffectiveUserId () const
 
virtual int64_t getEffectiveGroupId () const
 
virtual void getSupplementalGroupIds (Vector< int64_t > &vec) const
 
void setUserId (int64_t id)
 
void setGroupId (int64_t id)
 
void setEffectiveUserId (int64_t id)
 
void setEffectiveGroupId (int64_t id)
 
void setSupplementalGroupIds (const Vector< int64_t > &vec)
 
int64_t getSavedUserId () const
 
int64_t getSavedGroupId () const
 
void setSavedUserId (int64_t id)
 
void setSavedGroupId (int64_t id)
 
- Public Member Functions inherited from Process
 Process ()
 
 Process (Process *pParent, bool bCopyOnWrite=true)
 
virtual ~Process ()
 
size_t addThread (Thread *pThread)
 
void removeThread (Thread *pThread)
 
size_t getNumThreads ()
 
ThreadgetThread (size_t n)
 
size_t getId ()
 
LargeStaticStringdescription ()
 
VirtualAddressSpacegetAddressSpace ()
 
void setExitStatus (int code)
 
int getExitStatus ()
 
void reap ()
 
void kill () NORETURN
 
void suspend ()
 
void resume ()
 
ProcessgetParent ()
 
FilegetCwd ()
 
void setCwd (File *f)
 
FilegetCtty ()
 
void setCtty (File *f)
 
MemoryAllocatorgetSpaceAllocator ()
 
MemoryAllocatorgetDynamicSpaceAllocator ()
 
UsergetUser () const
 
void setUser (User *pUser)
 
UsergetEffectiveUser () const
 
void setEffectiveUser (User *pUser)
 
GroupgetGroup () const
 
void setGroup (Group *pGroup)
 
GroupgetEffectiveGroup () const
 
void setEffectiveGroup (Group *pGroup)
 
void setLinker (DynamicLinker *pDl)
 
DynamicLinkergetLinker ()
 
void setSubsystem (Subsystem *pSubsystem)
 
SubsystemgetSubsystem ()
 
void addWaiter (Semaphore *pWaiter)
 
void removeWaiter (Semaphore *pWaiter)
 
size_t waiterCount () const
 
bool hasSuspended ()
 
bool hasResumed ()
 
ProcessState getState () const
 
void markTerminating ()
 
void trackHeap (ssize_t nBytes)
 
void trackPages (ssize_t nVirtual, ssize_t nPhysical, ssize_t nShared)
 
void resetCounts ()
 
void recordTime (bool bUserspace)
 
void trackTime (bool bUserspace)
 
Time::Timestamp getUserTime () const
 
Time::Timestamp getKernelTime () const
 
Time::Timestamp getStartTime () const
 
ssize_t getHeapUsage () const
 
ssize_t getVirtualPageCount () const
 
ssize_t getPhysicalPageCount () const
 
ssize_t getSharedPageCount () const
 
void setRootFile (File *pFile)
 
FilegetRootFile () const
 
bool hasSharedAddressSpace () const
 

Private Member Functions

void registerProcess ()
 
void unregisterProcess ()
 
virtual void reportTimesUpdated (Time::Timestamp user, Time::Timestamp system)
 
virtual void processTerminated ()
 
 PosixProcess (const PosixProcess &)
 
PosixProcessoperator= (const PosixProcess &)
 

Private Attributes

PosixSessionm_pSession
 
ProcessGroupm_pProcessGroup
 
Membership m_GroupMembership
 
uint32_t m_Mask
 
RobustListData m_RobustListData
 
IntervalTimer m_RealIntervalTimer
 
IntervalTimer m_VirtualIntervalTimer
 
IntervalTimer m_ProfileIntervalTimer
 
int64_t m_Uid
 
int64_t m_Gid
 
int64_t m_Euid
 
int64_t m_Egid
 
int64_t m_Suid
 
int64_t m_Sgid
 
Vector< int64_t > m_SupplementalIds
 

Additional Inherited Members

- Static Public Member Functions inherited from Process
static ProcessgetInit ()
 
static void setInit (Process *pProcess)
 
- Public Attributes inherited from Process
Semaphore m_DeadThreads
 

Detailed Description

Definition at line 128 of file PosixProcess.h.

Member Enumeration Documentation

Defines what status this Process has within its group

Enumerator
Leader 

Group leader. The one who created the group, and whose PID was absorbed to become the Process Group ID.

Member 

Group member. These processes have a unique Process ID.

NoGroup 

Not in a group.

Definition at line 132 of file PosixProcess.h.

Constructor & Destructor Documentation

PosixProcess::PosixProcess ( Process pParent,
bool  bCopyOnWrite = true 
)

Member Function Documentation

Process::ProcessType PosixProcess::getType ( )
virtual

Gets the type of the Process (subsystems may override)

Reimplemented from Process.

Definition at line 153 of file PosixProcess.cc.

References ProcFs::addProcess(), VFS::instance(), VFS::lookupFilesystem(), and ProcFs::removeProcess().

int64_t PosixProcess::getUserId ( ) const
virtual

Direct, overrideable ways to get IDs (redirects to User/Group interface by default)

Reimplemented from Process.

Definition at line 415 of file PosixProcess.cc.

References Vector< T >::pushBack(), and Vector< T >::size().

void PosixProcess::processTerminated ( )
privatevirtual

Called when the process is terminated to allow for subclass cleanup.

Reimplemented from Process.

Definition at line 224 of file PosixProcess.cc.

References IntervalTimer::setIntervalAndValue().

void PosixProcess::reportTimesUpdated ( Time::Timestamp  user,
Time::Timestamp  system 
)
privatevirtual

Called when process times are updated.

Reimplemented from Process.

Definition at line 217 of file PosixProcess.cc.

References IntervalTimer::adjustValue().


The documentation for this class was generated from the following files: