hi all,
On our application we used the code sample btmgmt.c
which uses mgmt_new_default, this function will fail if
fd >127 (because mainloop_add_fd will fail in io_new function).
mgmt_new_default:
fd = socket(PF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, BTPROTO_HCI);
what is the best way to workaround this issue assuming I have only
btmgmt.c code and would rather not change other files?
thanks in advance
Ordit
Hi Ordit,
> On our application we used the code sample btmgmt.c
> which uses mgmt_new_default, this function will fail if
> fd >127 (because mainloop_add_fd will fail in io_new function).
>
> mgmt_new_default:
> fd = socket(PF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, BTPROTO_HCI);
>
> what is the best way to workaround this issue assuming I have only
> btmgmt.c code and would rather not change other files?
because we have #define MAX_MAINLOOP_ENTRIES 128 in the mainloop.c code. I assumed that 127 file descriptors is plenty for what any BlueZ application is doing.
Regards
Marcel