All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Ordit Gross <ordit.gross@orcam.com>
Cc: Bluez mailing list <linux-bluetooth@vger.kernel.org>
Subject: Re: mgmt_new_default sometimes fail
Date: Sun, 20 Oct 2019 19:08:12 +0200	[thread overview]
Message-ID: <406D15DB-1CD8-42DE-8A3C-640A4D24AC48@holtmann.org> (raw)
In-Reply-To: <CAB+bgRa-Lh0iR7nRe6kfFYqz_etHdYTjd+3MfWGWm8CRgTsa=w@mail.gmail.com>

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


      reply	other threads:[~2019-10-20 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 11:09 mgmt_new_default sometimes fail Ordit Gross
2019-10-20 17:08 ` Marcel Holtmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=406D15DB-1CD8-42DE-8A3C-640A4D24AC48@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=ordit.gross@orcam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.