Tan Nguyen
Tan Nguyen

Reputation: 323

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

From this post and this codebase, I know that there are pointers for

  1. Youngest child
  2. Youngest sibling
  3. Oldest sibling.

So with Oldest child, how do I get?

I am thinking of access "children" pointer (current->children) and traverse to the end of that doubly linked list.

Upvotes: 2

Views: 103

Answers (1)

Barmar
Barmar

Reputation: 781096

Get the oldest sibling of the youngest child:

current->p_cptr->p_osptr

Upvotes: 2

Related Questions