* mgmt_new_default sometimes fail
@ 2019-10-20 11:09 Ordit Gross
2019-10-20 17:08 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Ordit Gross @ 2019-10-20 11:09 UTC (permalink / raw)
To: linux-bluetooth
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mgmt_new_default sometimes fail
2019-10-20 11:09 mgmt_new_default sometimes fail Ordit Gross
@ 2019-10-20 17:08 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-10-20 17:08 UTC (permalink / raw)
To: Ordit Gross; +Cc: Bluez mailing list
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-20 17:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-20 11:09 mgmt_new_default sometimes fail Ordit Gross
2019-10-20 17:08 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.