shm_open question...

Hi all,

Actually this is related to the previous problem “subject: select problem”.
I found that after I have called shm_open with different shared memory
objects more than 27 times, thing gets corrupted, and it seems always
affecting the same place and the same routine. This in turn messes up the
“select” call. Is there any limit on how many time shm_open could be
called?

Thanks
kc

Beware of the FD_SETSIZE. See <sys/select.h>. The default
is 32 meaning that if you try to select() on an fd with
numerical value > 31, weird things can happen. Try something
like:

#define FD_SETSIZE 128
#include <sys/select.h>

-seanb

kc <kclee@netnobound.com> wrote:

Hi all,

Actually this is related to the previous problem “subject: select problem”.
I found that after I have called shm_open with different shared memory
objects more than 27 times, thing gets corrupted, and it seems always
affecting the same place and the same routine. This in turn messes up the
“select” call. Is there any limit on how many time shm_open could be
called?

Thanks
kc

I have been struggling with this problem for couple days already.
Thanks for reminding me about that. Everything is working fine now.

Thanks again.
kc


Sean Boudreau wrote:

Beware of the FD_SETSIZE. See <sys/select.h>. The default
is 32 meaning that if you try to select() on an fd with
numerical value > 31, weird things can happen. Try something
like:

#define FD_SETSIZE 128
#include <sys/select.h

-seanb

kc <> kclee@netnobound.com> > wrote:
Hi all,

Actually this is related to the previous problem “subject: select
problem”. I found that after I have called shm_open with different shared
memory objects more than 27 times, thing gets corrupted, and it seems
always affecting the same place and the same routine. This in turn messes
up the “select” call. Is there any limit on how many time shm_open could
be called?

Thanks
kc