I wanted to find all fds opened for a process in linux.
Can I do it with glib library functions ?
Since you're on Linux, you've (almost certainly) got the
/proc filesystem mounted. That means that the easiest method is going to be to get a list of the contents of
/proc/self/fd; each file in there is named after a FD. (Use
g_dir_close to do the listing, of course.)
Getting the information otherwise is moderately awkward (there's no helpful POSIX API for example; this is an area that wasn't standardized).