Printing child processes given a pid (MINIX)
<p>I'm working on a project at the moment and as part of it I need to implement system calls/library functions in MINIX.</p>

<p>As part of this I need to be able to print a list of child processes of a given process, using its pid. I think I've found part of what I need, but I'm stuck with making it work with a given pid.</p>

<pre><code>struct task_struct *task; 
struct list_head *list;

list_for_each(list, &amp;current-&gt;children) { 
    task = list_entry(list, struct task_struct, children); 
}
</code></pre>

<p>Does this seem like something close to what I'd need? I know that for passing a pid for me to use I'd need to use:</p>

<pre><code>struct task_struct find_task_by_pid(pid_t pid);
</code></pre>

<p>But combining this with the above isn't something I've done before.</p>