All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre FICHEUX <pierre.ficheux@smile.fr>
To: Philippe Gerum <rpm@xenomai.org>
Cc: Julien Blanc <julien.blanc@sprinte.eu>,
	Pierre FICHEUX via Xenomai <xenomai@xenomai.org>
Subject: Re: rt_task_inquire() equivalent for POSIX ?
Date: Thu, 7 Nov 2019 10:03:52 +0100	[thread overview]
Message-ID: <CAFc1U0trRygoKsURWkN1VeVVqh=XGwGp-CBXZmYfcnp8480P+g@mail.gmail.com> (raw)
In-Reply-To: <956fff32-9301-4b91-14b7-b2583f12508c@xenomai.org>

Thx a lot, works fine with cobalt_thread_pid() !

regards



Le jeu. 7 nov. 2019 à 09:44, Philippe Gerum <rpm@xenomai.org> a écrit :

> On 2019-11-07 08:56, Julien Blanc via Xenomai wrote:
> > Le jeudi 07 novembre 2019 à 06:47 +0100, Pierre FICHEUX via Xenomai a
> > écrit :
> >> I've tried it but got the pid of the "main" thread not the RT one
> >> (that's
> >> normal...).
> >>
> >
> > extern "C"
> > {
> >         int cobalt_thread_pid(pthread_t);
> > }
> >
> > int tid = cobalt_thread_pid(pthread_self())
> >
> > but i’m not sure what you mean by the cobalt thread id vs posix thread
> > id. IIRC they have the same value (ie, syscal(__NR_gettid) would give
> > the same value (for rt threads), maybe at the expense of a mode
> > switch).
>
> This may be worth a read for context:
> http://man7.org/linux/man-pages/man2/gettid.2.html
>
> cobalt_thread_pid() translates POSIX thread identifiers to kernel thread
> identifiers some Linux-specific calls need (e.g. thread-directed signals).
>
> --
> Philippe.
>


-- 

Pierre FICHEUX -/- CTO Smile ECS, France -\- pierre.ficheux@smile.fr
                             http://www.smile.fr
                             https://smile.eu/fr/offres/embarque-iot
I would love to change the world, but they won't give me the source code

  reply	other threads:[~2019-11-07  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 21:04 rt_task_inquire() equivalent for POSIX ? Pierre FICHEUX
2019-11-07  0:20 ` Lowell Gilbert
2019-11-07  5:47   ` Pierre FICHEUX
2019-11-07  7:56     ` Julien Blanc
2019-11-07  8:44       ` Philippe Gerum
2019-11-07  9:03         ` Pierre FICHEUX [this message]
2019-11-07  8:04 ` Steve Freyder

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='CAFc1U0trRygoKsURWkN1VeVVqh=XGwGp-CBXZmYfcnp8480P+g@mail.gmail.com' \
    --to=pierre.ficheux@smile.fr \
    --cc=julien.blanc@sprinte.eu \
    --cc=rpm@xenomai.org \
    --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.