dlclose question

When I use dlopen(hDLL) to open a shared library, spin shows me that I have
created a new fd. When I use dlclose(hDLL) to free the handle, I don’t see
the fd count drop in spin.I don’t have any errors associated wiith the open
or close calls. Do I need to do something additional to remove the fd?

Thanks,
Dave Kuechenmeister

Hi Dave,

I believe what you see is a deception :slight_smile:. Most likely the fd that appears is a result of some open(), which is probably called from another thread while you opening shared library. I think it is just coincidence.

Just in case try sin -P fd

The dlopen() never keeps dll file open. By the time when program returns from dlopen(), the dll fd is closed already. dlclose() only frees memory.

Sincerely,

Serge


When I use dlopen(hDLL) to open a shared library,
spin shows me that I have
created a new fd. When I use dlclose(hDLL) to free
the handle, I don’t see
the fd count drop in spin.I don’t have any errors
associated wiith the open
or close calls. Do I need to do something additional
to remove the fd?

Thanks,
Dave Kuechenmeister

Serge,
Thanks for the suggestion to use sin. I noticed in the “use” info that
sin reports itself to be a photon application, while in the RTP utilities
help section of our documentation, sin is a text program. Are there two
versions? I’m curious because our version, at /bin/sin, hangs every time I
try to use it. I don’t have photon on any of the computers, so I don’t know
what might be happening via graphics.

Thanks,
Dave


“Serge Yuschenko” <nospam@forums.openqnx.com> wrote in message
news:24729212.1040310512066.JavaMail.fliu@tiger…

Hi Dave,

I believe what you see is a deception > :slight_smile:> . Most likely the fd that appears
is a result of some open(), which is probably called from another thread

while you opening shared library. I think it is just coincidence.

Just in case try sin -P fd

The dlopen() never keeps dll file open. By the time when program returns
from dlopen(), the dll fd is closed already. dlclose() only frees memory.

Sincerely,

Serge


When I use dlopen(hDLL) to open a shared library,
spin shows me that I have
created a new fd. When I use dlclose(hDLL) to free
the handle, I don’t see
the fd count drop in spin.I don’t have any errors
associated wiith the open
or close calls. Do I need to do something additional
to remove the fd?

Thanks,
Dave Kuechenmeister
\

Dave,

There was a problem with sin usage. I’m not sure in what version. Probably in 6.1A. In 6.2 it’s gone.

Serge

Serge,
Thanks for the suggestion to use sin. I noticed in
in the “use” info that
sin reports itself to be a photon application, while
in the RTP utilities
help section of our documentation, sin is a text
program. Are there two
versions? I’m curious because our version, at
/bin/sin, hangs every time I
try to use it. I don’t have photon on any of the
computers, so I don’t know
what might be happening via graphics.

Thanks,
Dave

[snip]