1 #include <lunaix/fs/taskfs.h>
4 __read_pending_sig(struct twimap* map)
6 struct proc_info* proc = twimap_data(map, struct proc_info*);
7 twimap_printf(map, "%bb", proc->sig_pending);
11 __read_masked_sig(struct twimap* map)
13 struct proc_info* proc = twimap_data(map, struct proc_info*);
14 twimap_printf(map, "%bb", proc->sig_mask);
18 __read_parent(struct twimap* map)
20 struct proc_info* proc = twimap_data(map, struct proc_info*);
21 twimap_printf(map, "%d", proc->parent->pid);
25 __read_ctimestamp(struct twimap* map)
27 struct proc_info* proc = twimap_data(map, struct proc_info*);
28 twimap_printf(map, "%d", proc->created);
32 __read_pgid(struct twimap* map)
34 struct proc_info* proc = twimap_data(map, struct proc_info*);
35 twimap_printf(map, "%d", proc->pgid);
39 __read_children(struct twimap* map)
41 struct proc_info* proc = twimap_index(map, struct proc_info*);
44 twimap_printf(map, "%d ", proc->pid);
48 __next_children(struct twimap* map)
50 struct proc_info* proc = twimap_index(map, struct proc_info*);
53 map->index = container_of(proc->siblings.next, struct proc_info, siblings);
54 if (map->index == proc) {
61 __reset_children(struct twimap* map)
63 struct proc_info* proc = twimap_data(map, struct proc_info*);
64 if (llist_empty(&proc->children)) {
68 map->index = container_of(proc->children.next, struct proc_info, siblings);
75 map = twimap_create(NULL);
76 map->read = __read_pending_sig;
77 taskfs_export_attr("sig_pending", map);
79 map = twimap_create(NULL);
80 map->read = __read_masked_sig;
81 taskfs_export_attr("sig_masked", map);
83 map = twimap_create(NULL);
84 map->read = __read_parent;
85 taskfs_export_attr("parent", map);
87 map = twimap_create(NULL);
88 map->read = __read_ctimestamp;
89 taskfs_export_attr("created", map);
91 map = twimap_create(NULL);
92 map->read = __read_pgid;
93 taskfs_export_attr("pgid", map);
95 map = twimap_create(NULL);
96 map->read = __read_children;
97 map->go_next = __next_children;
98 map->reset = __reset_children;
99 taskfs_export_attr("children", map);