From: arigead@gmail.com (John Whitmore)
To: kernelnewbies@lists.kernelnewbies.org
Subject: timer_t invalid value?
Date: Fri, 7 Feb 2014 19:44:46 +0000 [thread overview]
Message-ID: <20140207194445.GA28637@griso.site> (raw)
Hi all, I've got some code, a protocol I wrote, from an embedded processor
which I'm trying to port to Linux User Space, (to run on a Raspberry
Pi). Going to get my embedded device talking to the RPi.
Fortunately I wrote the embedded code so can change it to better fit with the
Linux User Space. In addition I can write a shim layer between my protocol
code and Linux.
My question is about timer_t. I've been searching through documentation but
can't find mention of any value that is considered an invalid timer
identifier. My embedded code's timer creation function would be something like:
timer_id = start_timer(duration, expiry_function);
The returned timer_id if set to the invalid value has not been started. In
addition when an event occurs in the protocol if the timer_id is not that
invalid value then stop the timer. So the timer_id stored tells you if it's
valid and running. As soon as the timer expires the expiry function returns
the value to the INVLAID_TIMER_ID value.
>From what I can tell in Linux there is no such Invalid value. A timer_t is just
an integer and all values are valid. This being the case in my protocol code
I'd have to change it so all timer id's are valid and another variable would
have to store the status/validity of the timer variable. Is this the case?
Just wanted to confirm this before I go re-writing.
Hope that isn't considered off topic, it is linux programming related-ish.
reply other threads:[~2014-02-07 19:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20140207194445.GA28637@griso.site \
--to=arigead@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).