Printing file descriptors from PID in C on Linux
<p>So I have to print names of all the file descriptors of a certain PID. I know how to access it through the terminal navigating to <code>proc/[pid]/fd</code>, but all I get are colored numbers. I can get their name by writing <code>ls -l</code>. </p>

<hr>

<p>My Question is how can I print these names in C. I tried using <code>stat</code>, but I couldn't get it to work, then I used <code>g_dir_open</code>. It didn't work aswell since i couldn't properly include <code>glib.h</code> (<code>"galloca.h not found in glib.h"</code>).</p>

<p>Thank you very much in advance,
Oh and please keep in mind that I'm a complete fool when it comes to linux.</p>