I’m not sure if there is anything that can be done, but I ran across an issue that maybe someone else can help me come up with a way to workaround. I’m working on a system where I need to develop a daemon that monitor’s the system status and transmits it to an LCD display driven by an XEM if one is connected.
My problem is rooted in the fact that API calls such as GetDeviceCount appear to consume file descriptors each time I call them (and never close them). Eventually I bump into the per-process file descriptor limit. Has anyone else run into this problem? Are there any solutions?
I’ve put together a simple program that demonstrates the issue. I’m curious to see if you run into the same issue if this source is compiled and run on a system without a FrontPanel capable device connected to it.
#include "okFrontPanelDLL.h"
int main(int argc, char **argv) {
if (okFrontPanelDLL_LoadLib(NULL) != true){
exit(1);
}
okCUsbFrontPanel *xem = new okCUsbFrontPanel;
while (xem->GetDeviceCount()
All that miscellaneous printing to stdout aside (eventually I’ll need to supress this as well), the interesting bits are at the end. I’ll also attach an strace (with -e trace=desc) output that shows that the file descriptors are indeed not being released
I ran these tests with FrontPanel 3.0.10 (I can’t try 3.0.11 because the FC7 builds are not compatible with my debian etch system)
Any help is appreciated.
Cheers,
Evan
strace_file_desc.zip (29.5 KB)