Skip navigation.
The QNX Community Portal

View topic - QNX File Descriptor Leak

Page 1 of 1

QNX File Descriptor Leak

PostPosted: Wed Dec 14, 2016 10:03 am
by vjeevana
Working on a platform with below details

QNX localhost 6.3.0 2008/01/15-13:30:11EST IXP_23xx armbe

One of our application process leaks file descriptor. We found that file descriptor leakage happens by print "Too many open files" . Then we verified file leakgae be below program (I have pasted only skeleton/logic of the program)

(dir = opendir ("/proc"))
pid = atoi (dirent -> d_name)
sprintf (paths, "/proc/%d/as", pid);
fd = open (paths, O_RDONLY)
devctl (fd, DCMD_PROC_INFO, &info, sizeof (info), 0)
printf("files allocated %u\n",info.num_fdcons)

In QNX we are not able to find out api which will enable us to find out list of file descriptors and their properties opened by the process.(pidin -o is available only from 6.3.2.. we are using 6.3.0 . sin command is also not supported).