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 llist_header* proc_list = twimap_index(map, struct llist_header*);
42 struct proc_info* proc =
43 container_of(proc_list, struct proc_info, siblings);
46 twimap_printf(map, "%d ", proc->pid);
50 __next_children(struct twimap* map)
52 struct llist_header* proc = twimap_index(map, struct llist_header*);
53 struct proc_info* current = twimap_data(map, struct proc_info*);
56 map->index = proc->next;
57 if (map->index == ¤t->children) {
64 __reset_children(struct twimap* map)
66 struct proc_info* proc = twimap_data(map, struct proc_info*);
67 if (llist_empty(&proc->children)) {
71 map->index = proc->children.next;
78 map = twimap_create(NULL);
79 map->read = __read_pending_sig;
80 taskfs_export_attr("sig_pending", map);
82 map = twimap_create(NULL);
83 map->read = __read_masked_sig;
84 taskfs_export_attr("sig_masked", map);
86 map = twimap_create(NULL);
87 map->read = __read_parent;
88 taskfs_export_attr("parent", map);
90 map = twimap_create(NULL);
91 map->read = __read_ctimestamp;
92 taskfs_export_attr("created", map);
94 map = twimap_create(NULL);
95 map->read = __read_pgid;
96 taskfs_export_attr("pgid", map);
98 map = twimap_create(NULL);
99 map->read = __read_children;
100 map->go_next = __next_children;
101 map->reset = __reset_children;
102 taskfs_export_attr("children", map);