see this code.
It will always has a pid 0 sibling even if there is actually no sibling.
And if I use p->parent->children then everything works fine.
p->parent->children