This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: arm a timer with initial expiration set to 0, doesnt work
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "jenia.ivlev" <jenia dot ivlev at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 24 Nov 2014 00:27:41 +0000
- Subject: Re: arm a timer with initial expiration set to 0, doesnt work
- Authentication-results: sourceware.org; auth=none
- References: <87bnnx62z8 dot fsf at gmail dot com>
On 23 November 2014 at 21:06, jenia.ivlev wrote:
>
>
> Hello.
>
> I'm going through the book Posix Programming interface.
> When I set the timer timer_t, I set the itimerspec's first expiration to
> 1, and run the program, the timer works fine. When I set it to 0, it
> doesnt work anymore.
>
> Let me show you what I mean:
>
> void itimerspecFromStr(char *interval, struct itimerspec *tsp)
> {
> tsp->it_value.tv_sec = 1; //<-------------- when its set to one, it works.
> tsp->it_value.tv_nsec = 0;
> tsp->it_interval.tv_sec = atoi(interval);
> tsp->it_interval.tv_nsec = 0;
> }
>
> When I set that value to zero, and run the same program, it doesnt work
> anymore.
> Is that normal?
Your question is not about GCC, so this mailing list is not the
appropriate place to ask.
(It's like asking the manufacturer of your car for directions when
you're lost, just because you're using their car doesn't mean they
know where you're going or how to get there.)