7#include <cosmos/proc/clone.hxx>
10#include <clues/SystemCallItem.hxx>
12namespace clues::item {
14class CLUES_API CloneFlagsValue :
18 explicit CloneFlagsValue() :
22 std::string
str()
const override;
24 cosmos::CloneFlags flags()
const {
28 std::optional<cosmos::SignalNr> exitSignal()
const {
38 cosmos::CloneFlags m_flags;
44class CLUES_API CloneArgs :
48 explicit CloneArgs() :
60 const std::optional<cosmos::CloneArgs>&
args()
const {
89 cosmos::ThreadID
tid()
const {
93 std::string str()
const override;
95 void processValue(
const Tracee&)
override;
97 void updateData(
const Tracee &proc)
override;
101 bool verifySize()
const;
107 std::optional<cosmos::CloneArgs> m_args;
108 cosmos::FileNum m_pidfd = cosmos::FileNum::INVALID;
109 cosmos::FileNum m_cgroup2_fd = cosmos::FileNum::INVALID;
110 cosmos::ThreadID m_child_tid = cosmos::ThreadID::INVALID;
111 std::vector<cosmos::ThreadID> m_tid_array;
SystemCallItem(const ItemType type, const std::string_view short_name={}, const std::string_view long_name={})
Constructs a new SystemCallItem.
Base class for traced processes.
cosmos::FileNum cgroup2fd() const
Return the cgroup2 file descriptor for the child to be placed in.
cosmos::FileNum pidfd() const
Return the newly created PIDFD.
cosmos::ThreadID tid() const
Return the new child's ThreadID stored in parent's memory.
const std::optional< cosmos::CloneArgs > & args() const
Returns an optional containing the cosmos::CloneArgs structure, if available.
std::optional< cosmos::SignalNr > exit_signal
For clone() 1/2 this contains the child exit signal, which is additionally encoded in the flags.
void processValue(const Tracee &) override
Processes the value stored in m_val acc. to the actual item type.
std::string str() const override
Returns a human readable string representation of the item.
@ PARAM_IN
An input parameter to the system call.
@ PARAM_IN_OUT
Both an input and output parameter.