wire / wire-format / task-struct
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).
aka: Linux task_struct (process descriptor)
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).
| field | size | meaning |
|---|---|---|
| state | long | Task state: TASK_RUNNING, TASK_INTERRUPTIBLE, TASK_UNINTERRUPTIBLE, TASK_STOPPED, TASK_TRACED, EXIT_ZOMBIE, EXIT_DEAD. |
| pid | pid_t | Process ID (thread ID in kernel terms). |
| tgid | pid_t | Thread group ID (userspace PID). |
| comm | 16 bytes (char[16]) | Command name (executable name, truncated to 15 chars + NUL). |
| mm | pointer (struct mm_struct *) | Memory descriptor: VMAs, page tables, mmap, brk, etc. |
| files | pointer (struct files_struct *) | File descriptor table. |
| fs | pointer (struct fs_struct *) | Filesystem info: root, pwd, umask. |
| signal | pointer (struct signal_struct *) | Signal handlers and pending signals. |
| sched | embedded (struct sched_entity) | Scheduling info: priority, vruntime, CPU affinity, load weight. |
| parent | pointer (struct task_struct *) | Parent process. |
| children | list_head | List of child processes. |
| cred | pointer (const struct cred *) | Credentials: uid, gid, euid, egid, capabilities, securebits. |
| ns | pointer (struct nsproxy *) | Namespaces: pid, net, mount, uts, ipc, user, cgroup, time. |
| thread | embedded (struct thread_struct) | Thread-specific: CPU registers, FPU state, TLS, etc. |
example:
00 00 00 00 00 00 00 00
task_struct (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/task-struct
or /wire-format/task-struct.json