wire / wire-format / task-struct

Linux task_struct (process descriptor)

The Linux task_struct is the process descriptor, containing all information about a process/thread. Key fields: state (running, sleeping, stopped, zombie), pid (process ID), tgid (thread group ID), comm (command name, 16 chars), mm (memory descriptor), files (file descriptor table), fs (filesystem info), signal (signal handlers), sched (scheduling info: priority, policy, CPU affinity), parent (parent task), children (list of children), sibling (sibling in parent's children list), thread (thread-specific data), cred (credentials: uid, gid, capabilities), ns (namespaces: pid, net, mount, uts, ipc, user, cgroup, time).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Linux task_struct (process descriptor)

wire format

spec: Linux kernel

The Linux task_struct is the process descriptor, containing all information about a process/thread. Key fields: state (running, sleeping, stopped, zombie), pid (process ID), tgid (thread group ID), comm (command name, 16 chars), mm (memory descriptor), files (file descriptor table), fs (filesystem info), signal (signal handlers), sched (scheduling info: priority, policy, CPU affinity), parent (parent task), children (list of children), sibling (sibling in parent's children list), thread (thread-specific data), cred (credentials: uid, gid, capabilities), ns (namespaces: pid, net, mount, uts, ipc, user, cgroup, time).

fieldsizemeaning
statelongTask state: TASK_RUNNING, TASK_INTERRUPTIBLE, TASK_UNINTERRUPTIBLE, TASK_STOPPED, TASK_TRACED, EXIT_ZOMBIE, EXIT_DEAD.
pidpid_tProcess ID (thread ID in kernel terms).
tgidpid_tThread group ID (userspace PID).
comm16 bytes (char[16])Command name (executable name, truncated to 15 chars + NUL).
mmpointer (struct mm_struct *)Memory descriptor: VMAs, page tables, mmap, brk, etc.
filespointer (struct files_struct *)File descriptor table.
fspointer (struct fs_struct *)Filesystem info: root, pwd, umask.
signalpointer (struct signal_struct *)Signal handlers and pending signals.
schedembedded (struct sched_entity)Scheduling info: priority, vruntime, CPU affinity, load weight.
parentpointer (struct task_struct *)Parent process.
childrenlist_headList of child processes.
credpointer (const struct cred *)Credentials: uid, gid, euid, egid, capabilities, securebits.
nspointer (struct nsproxy *)Namespaces: pid, net, mount, uts, ipc, user, cgroup, time.
threadembedded (struct thread_struct)Thread-specific: CPU registers, FPU state, TLS, etc.

example:

00 00 00 00 00 00 00 00

task_struct (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/task-struct or /wire-format/task-struct.json