From: Sebastian Smolorz <Sebastian.Smolorz@gmx.de>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai] Retrieval of user fd from struct rtdm_fd
Date: Sun, 14 Oct 2018 21:27:07 +0200 [thread overview]
Message-ID: <2060132.jtzqTOXOF1@lenni> (raw)
Hello Philippe or Jan,
I need to retrieve the socket file descriptor from an RTDM device driver
routine. From what I have seen there is no simple way to obtain this int
value from struct rtdm_fd. I have identified three possible ways to do
this, all of them necessitate modification of Xenomai code outside the
driver:
1. Iterate over the rb_tree rtdm_fd->owner->fds by means of the macro
xntree_for_each_entry(pos, root, member). For this macro to work the
definition of struct rtdm_fd_index must be known to the driver which
means that it would have to be moved from kernel/cobalt/rtdm/fd.c to
e.g. include/cobalt/kernel/rtdm/fd.h.
2. Similar to 1. but offer a new function rtdm_fd_get_ufd(struct rtdm_fd
*fd) in which the rb_tree is searched.
3. Introduce a new value "int ufd" in struct rtdm_fd for setting and
getting the ufd directly (which would be overkill I suppose because the
vast majority of drivers don't need it).
What do you think, which of the above would you prefer?
--
Sebastian
next reply other threads:[~2018-10-14 19:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-14 19:27 Sebastian Smolorz [this message]
2018-10-15 8:26 ` [Xenomai] Retrieval of user fd from struct rtdm_fd Philippe Gerum
2018-10-15 8:46 ` Sebastian Smolorz
2018-10-15 11:18 ` Jan Kiszka
2018-10-15 13:17 ` Sebastian Smolorz
2018-10-15 13:28 ` Philippe Gerum
2018-10-15 13:30 ` Jan Kiszka
2018-10-15 13:35 ` Sebastian Smolorz
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=2060132.jtzqTOXOF1@lenni \
--to=sebastian.smolorz@gmx.de \
--cc=xenomai@xenomai.org \
/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.