I wanted to find all fds opened for a process in linux.
Can I do it with glib library functions ?
If you mean how can you do it programatically from within the process then the normal (if slightly horrid) method is to do something like looping over all possible descriptors (use getrlimit() to read RLIMIT_NOFILE to find the range) calling something like fcntl(fd, F_GETFD, 0) on each one and checking for EBADF responses to see which ones are not open.
If you mean that you want to find out from the shell what files a process has open then lsof -p is what you want.