libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
clues::GetXIdSystemCall< ID_T > Struct Template Reference
+ Inheritance diagram for clues::GetXIdSystemCall< ID_T >:

Public Member Functions

 GetXIdSystemCall (const SystemCallNr nr)
 
- Public Member Functions inherited from clues::SystemCall
 SystemCall (const SystemCallNr nr)
 Instantiates a new SystemCall object with given properties.
 
 SystemCall (const SystemCall &other)=delete
 
SystemCalloperator= (const SystemCall &other)=delete
 
void setEntryInfo (const Tracee &proc, const SystemCallInfo &info)
 Update the stored parameter values from the given tracee.
 
void setExitInfo (const Tracee &proc, const SystemCallInfo &info)
 Update possible out and return parameter values from the given tracee.
 
std::string_view name () const
 Returns the system call's human readable name.
 
size_t numPars () const
 Returns the number of parameters for this system call.
 
SystemCallNr callNr () const
 Returns the system call table number for this system call.
 
const ParameterVectorparameters () const
 Access to the parameters associated with this system call.
 
SystemCallItemPtr result () const
 Access to the return value parameter associated with this system call.
 
std::optional< ErrnoResulterror () const
 Access to the errno result seen for this system call.
 
bool hasOutParameter () const
 
bool hasResultValue () const
 
bool hasErrorCode () const
 
ABI abi () const
 Returns the system call ABi seen during system call entry.
 
bool is32BitEmulationABI () const
 
const SystemCallInfocurrentInfo () const
 Access the current SystemCallInfo if currently processing syscall entry/exit.
 

Public Attributes

ID_T id
 the UserID or GroupID
 

Protected Member Functions

const char * getShortLabel ()
 
const char * getLongLabel ()
 
- Protected Member Functions inherited from clues::SystemCall
void fillParameters (const Tracee &proc, const SystemCallInfo &info)
 
void setReturnItem (SystemCallItem &ret)
 Sets the return value system call item.
 
void addParameters ()
 
template<typename T, typename... Targs>
void addParameters (T &par, Targs &...rest)
 
template<typename... Targs>
void setParameters (Targs &...args)
 
virtual bool check2ndPass (const Tracee &)
 Check whether a second pass needs to be made processing parameters.
 
virtual void prepareNewSystemCall ()
 Perform any necessary actions before processing a new system call entry event.
 
virtual void updateFDTracking (const Tracee &proc)
 Update file descriptor tracking.
 
void dropFD (const Tracee &proc, const cosmos::FileNum num)
 
void trackFD (const Tracee &proc, FDInfo &&info)
 

Additional Inherited Members

- Public Types inherited from clues::SystemCall
using ParameterVector = std::vector<SystemCallItemPtr>
 Vector of the parameters required for a system call.
 
- Static Public Member Functions inherited from clues::SystemCall
static const char * name (const SystemCallNr nr)
 Returns the name of the given system call or "<unknown>" if unknown.
 
static bool validNr (const SystemCallNr nr)
 Returns whether the given system call number is in a valid range.
 
- Protected Attributes inherited from clues::SystemCall
SystemCallNr m_nr
 The raw system call number of the system call.
 
const std::string_view m_name
 The basic name of the system call.
 
const SystemCallInfom_info = nullptr
 Current system call info during entry/exit processing, nullptr otherwise.
 
SystemCallItemPtr m_return
 The return value of the system call.
 
std::optional< ErrnoResultm_error
 If the system call fails, this is the error code.
 
ParameterVector m_pars
 The array of system call parameters, if any.
 
ABI m_abi = ABI::UNKNOWN
 The current system call ABI which is in effect.
 

Detailed Description

template<typename ID_T>
struct clues::GetXIdSystemCall< ID_T >

Definition at line 195 of file process.hxx.

Constructor & Destructor Documentation

◆ GetXIdSystemCall()

template<typename ID_T>
clues::GetXIdSystemCall< ID_T >::GetXIdSystemCall ( const SystemCallNr nr)
inline

Definition at line 198 of file process.hxx.

198 :
199 SystemCall{nr},
200 id{ItemType::RETVAL, getShortLabel(), getLongLabel()} {
201 setReturnItem(id);
202 }
void setReturnItem(SystemCallItem &ret)
Sets the return value system call item.
SystemCall(const SystemCallNr nr)
Instantiates a new SystemCall object with given properties.

Member Function Documentation

◆ getLongLabel()

template<typename ID_T>
const char * clues::GetXIdSystemCall< ID_T >::getLongLabel ( )
inlineprotected

Definition at line 223 of file process.hxx.

223 {
224 switch (callNr()) {
226 case SystemCallNr::GETUID: return "real user ID";
228 case SystemCallNr::GETEUID: return "effective user ID";
230 case SystemCallNr::GETGID: return "real group ID";
232 case SystemCallNr::GETEGID: return "effective group ID";
233 default: return "???";
234 }
235 }
SystemCallNr callNr() const
Returns the system call table number for this system call.

◆ getShortLabel()

template<typename ID_T>
const char * clues::GetXIdSystemCall< ID_T >::getShortLabel ( )
inlineprotected

Definition at line 209 of file process.hxx.

209 {
210 switch (callNr()) {
212 case SystemCallNr::GETUID: return "uid";
214 case SystemCallNr::GETEUID: return "euid";
216 case SystemCallNr::GETGID: return "gid";
218 case SystemCallNr::GETEGID: return "egid";
219 default: return "???";
220 }
221 }

Member Data Documentation

◆ id

template<typename ID_T>
ID_T clues::GetXIdSystemCall< ID_T >::id

the UserID or GroupID

Definition at line 205 of file process.hxx.


The documentation for this struct was generated from the following file: