<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Vorformatiert Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:"Courier New";}
span.E-MailFormatvorlage21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.o
{mso-style-name:o;}
span.E-MailFormatvorlage25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Chris,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Did you compile ptpd with kqueue only? I’ve tried with posix timer, which are implemented in rtems, but it seems that the handler with siginfo_t is not called correctly. I’ve managed to get it working using a workaround but I’ll continue
with kqueue, thx!.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Gabriel<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE">Von:</span></b><span lang="DE"> Chris Johns <chrisj@rtems.org>
<br>
<b>Gesendet:</b> Mittwoch, 19. Mai 2021 10:30<br>
<b>An:</b> Moyano Heredia, Victor Gabriel <Gabriel.Moyano@dlr.de><br>
<b>Cc:</b> devel@rtems.org<br>
<b>Betreff:</b> Re: question about posix timer expiration<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">On 18 May 2021, at 10:02 pm, <a href="mailto:Gabriel.Moyano@dlr.de">
Gabriel.Moyano@dlr.de</a> wrote:<o:p></o:p></p>
</blockquote>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">From further investigation I’ve found that when a timer expires, _POSIX_Timer_TSR() is called and this uses pthread_kill() to send a signal. Shouldn’t ptimer->inf.sigev_value be used here in order to create a siginfo_t object with the right
value?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Did anyone have to deal with this while using posix timers?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE">Von:</span></b><span lang="DE"> devel <<a href="mailto:devel-bounces@rtems.org">devel-bounces@rtems.org</a>>
<b>Im Auftrag von </b><a href="mailto:Gabriel.Moyano@dlr.de">Gabriel.Moyano@dlr.de</a><br>
<b>Gesendet:</b> Mittwoch, 12. Mai 2021 14:37<br>
<b>An:</b> <a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<b>Betreff:</b> question about posix timer expiration</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Hello everyone,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Currently I am trying to get running ptpd on rtems (following the Chris’ work, thx btw).<o:p></o:p></p>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Ptpd uses posix timers and when a timer expires a handler with this signature void(int sig, siginfo_t *info, void *ucontext) is called.</span><o:p></o:p></pre>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Is this on libbsd? If it is I would have expected kqueue being used so I am not sure where this is happening. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Chris<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Unfortunately (*info) doesn’t have the right values, eg. info->si_code should be SI_TIMER but it is SI_USER and also info->si_signo should be the same as sig but it’s not.</span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Diving into the code I’ve found where the handler is called (also where *info is created). This is done in the function _<i>POSIX_signals_Check</i>_signal() in the file psignalunblockthread.c. It doesn’t seems that info is updated with the values (I guess) should take from object ptimer, which was created by create_timer().</span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">My question is: is this handler fully supported? Or maybe I’m missing something else.</span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> </span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Thanks in advance,</span><o:p></o:p></pre>
<pre><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Gabriel</span><o:p></o:p></pre>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="punctuation-wrap:simple;text-autospace:none"><span lang="DE" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:dimgray">——————————————————————————</span><o:p></o:p></p>
<p class="MsoNormal" style="punctuation-wrap:simple;text-autospace:none"><b><span lang="DE" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:dimgray">Deutsches Zentrum für Luft- und Raumfahrt</span></b><span lang="DE" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:dimgray">
e.V. (DLR)</span><o:p></o:p></p>
<p class="MsoNormal" style="line-height:16.0pt;punctuation-wrap:simple;text-autospace:none">
<a name="Institut"></a><span lang="DE" style="font-size:8.5pt;font-family:"Arial",sans-serif;color:dimgray">Institute for Software Technology | SC-OSS | Lilienthalplatz 7 | 38108 Braunschweig | Germany</span><o:p></o:p></p>
<p class="MsoNormal" style="punctuation-wrap:simple;text-autospace:none"><span lang="DE" style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal" style="punctuation-wrap:simple;text-autospace:none"><a name="Funktion"></a><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:dimgray">Gabriel Moyano</span></b><span style="font-size:8.5pt;font-family:"Arial",sans-serif;color:dimgray">
| Research Scientist in Onboard Software Systems group</span><o:p></o:p></p>
<p class="MsoNormal" style="line-height:16.0pt;punctuation-wrap:simple;text-autospace:none">
<a name="Telefon"></a><span lang="DE" style="font-size:8.5pt;font-family:"Arial",sans-serif;color:dimgray"><a href="mailto:gabriel.moyano@dlr.de"><span lang="EN-US">gabriel.moyano@dlr.de</span></a></span><o:p></o:p></p>
<p class="MsoNormal" style="line-height:16.0pt;punctuation-wrap:simple;text-autospace:none">
<span lang="DE" style="font-size:8.5pt;font-family:"Arial",sans-serif;color:dimgray"><a href="http://www.dlr.de/"><span lang="EN-US">DLR.de</span></a></span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel">http://lists.rtems.org/mailman/listinfo/devel</a><o:p></o:p></p>
</div>
</blockquote>
</div>
</body>
</html>