查找进程 (task_struct) 中最早的 child(非同级)

Find oldest child (not sibling) of a process (task_struct)

从这个post and this codebase,我知道有

的指针
  1. 最小的child
  2. 最小的兄弟姐妹
  3. 最年长的兄弟姐妹。

所以有了 Oldest child,我怎么得到?

我正在考虑访问“children”指针(current->children)并遍历到那个双向链表的末尾。

获取最小的兄弟姐妹child:

current->p_cptr->p_osptr