Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - problem with clock_settime() function on QNX 6.4.0: (17 Items)
   
problem with clock_settime() function on QNX 6.4.0  
hi,
I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
I am facing issues with clocksettime() function to set the system clock.
The input parameter to that function is the address of a  time spec structure.
The values passed to tv_sec,tv_nsec are fine.
But unable to set the system clock as per the values.
In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
The function is not returning any error still its not setting the system time.
Do i need to set any proccessor plag for the function to work??
Is there any limitation on "tv_sec " value also??
I have taken care that the time should not cross "year 2038"
thwn why the function does not work???


Re: problem with clock_settime() function on QNX 6.4.0  
is there any delay setting the system clock time???on QNX 6.4.0?? on ppc target??
Re: problem with clock_settime() function on QNX 6.4.0  
After setting the system time by clock_settime() function 
if i give sytem("date"); command its able to show the updated time.
What could be the reason.?
Re: problem with clock_settime() function on QNX 6.4.0  
Can you post an example of the code you are using?

soujanya Yelchuri wrote:
> hi,
> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
> I am facing issues with clocksettime() function to set the system clock.
> The input parameter to that function is the address of a  time spec structure.
> The values passed to tv_sec,tv_nsec are fine.
> But unable to set the system clock as per the values.
> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
> The function is not returning any error still its not setting the system time.
> Do i need to set any proccessor plag for the function to work??
> Is there any limitation on "tv_sec " value also??
> I have taken care that the time should not cross "year 2038"
> thwn why the function does not work???
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post36153
> 

-- 
cburgess@qnx.com
RE: problem with clock_settime() function on QNX 6.4.0  
	stime.tv_nsec = 0;
	stime.tv_sec += (60*60)*24L;  /* Add one day */
	// Set the time
	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
	{
		perror( "could not setclock" );
	}


-----Original Message-----
From: Colin Burgess [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 19, 2009 8:32 PM
To: momentics-community
Subject: Re: problem with clock_settime() function on QNX 6.4.0

Can you post an example of the code you are using?

soujanya Yelchuri wrote:
> hi,
> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
> I am facing issues with clocksettime() function to set the system clock.
> The input parameter to that function is the address of a  time spec structure.
> The values passed to tv_sec,tv_nsec are fine.
> But unable to set the system clock as per the values.
> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
> The function is not returning any error still its not setting the system time.
> Do i need to set any proccessor plag for the function to work??
> Is there any limitation on "tv_sec " value also??
> I have taken care that the time should not cross "year 2038"
> thwn why the function does not work???
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post36153
> 

-- 
cburgess@qnx.com



_______________________________________________

QNX Momentics Community Support
http://community.qnx.com/sf/go/post36269


Re: problem with clock_settime() function on QNX 6.4.0  
Ok, so to clarify

this worked on 6.3.0
it doesn't set the system clock on 6.4.0

does the date utility work (to set the clock?) - it uses clock_settime too.

Colin

soujanya Yelchuri wrote:
> 	stime.tv_nsec = 0;
> 	stime.tv_sec += (60*60)*24L;  /* Add one day */
> 	// Set the time
> 	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
> 	{
> 		perror( "could not setclock" );
> 	}
> 
> 
> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 19, 2009 8:32 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> Can you post an example of the code you are using?
> 
> soujanya Yelchuri wrote:
>> hi,
>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>> I am facing issues with clocksettime() function to set the system clock.
>> The input parameter to that function is the address of a  time spec structure.
>> The values passed to tv_sec,tv_nsec are fine.
>> But unable to set the system clock as per the values.
>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>> The function is not returning any error still its not setting the system time.
>> Do i need to set any proccessor plag for the function to work??
>> Is there any limitation on "tv_sec " value also??
>> I have taken care that the time should not cross "year 2038"
>> thwn why the function does not work???
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> QNX Momentics Community Support
>> http://community.qnx.com/sf/go/post36153
>>
> 

-- 
cburgess@qnx.com
RE: problem with clock_settime() function on QNX 6.4.0  
No if u use date -s no.sec at that time its diplaying correctly but afterwards it shows the old time..

Regards,
Soujanya Yelchuri

-----Original Message-----
From: Colin Burgess [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 19, 2009 8:42 PM
To: momentics-community
Subject: Re: problem with clock_settime() function on QNX 6.4.0

Ok, so to clarify

this worked on 6.3.0
it doesn't set the system clock on 6.4.0

does the date utility work (to set the clock?) - it uses clock_settime too.

Colin

soujanya Yelchuri wrote:
> 	stime.tv_nsec = 0;
> 	stime.tv_sec += (60*60)*24L;  /* Add one day */
> 	// Set the time
> 	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
> 	{
> 		perror( "could not setclock" );
> 	}
> 
> 
> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 19, 2009 8:32 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> Can you post an example of the code you are using?
> 
> soujanya Yelchuri wrote:
>> hi,
>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>> I am facing issues with clocksettime() function to set the system clock.
>> The input parameter to that function is the address of a  time spec structure.
>> The values passed to tv_sec,tv_nsec are fine.
>> But unable to set the system clock as per the values.
>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>> The function is not returning any error still its not setting the system time.
>> Do i need to set any proccessor plag for the function to work??
>> Is there any limitation on "tv_sec " value also??
>> I have taken care that the time should not cross "year 2038"
>> thwn why the function does not work???
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> QNX Momentics Community Support
>> http://community.qnx.com/sf/go/post36153
>>
> 

-- 
cburgess@qnx.com



_______________________________________________

QNX Momentics Community Support
http://community.qnx.com/sf/go/post36275


Re: problem with clock_settime() function on QNX 6.4.0  
date -s no.sec doesn't set the date, it just turns the seconds into a date string.

soujanya Yelchuri wrote:
> No if u use date -s no.sec at that time its diplaying correctly but afterwards it shows the old time..
> 
> Regards,
> Soujanya Yelchuri
> 
> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 19, 2009 8:42 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> Ok, so to clarify
> 
> this worked on 6.3.0
> it doesn't set the system clock on 6.4.0
> 
> does the date utility work (to set the clock?) - it uses clock_settime too.
> 
> Colin
> 
> soujanya Yelchuri wrote:
>> 	stime.tv_nsec = 0;
>> 	stime.tv_sec += (60*60)*24L;  /* Add one day */
>> 	// Set the time
>> 	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
>> 	{
>> 		perror( "could not setclock" );
>> 	}
>>
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com] 
>> Sent: Wednesday, August 19, 2009 8:32 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Can you post an example of the code you are using?
>>
>> soujanya Yelchuri wrote:
>>> hi,
>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>> I am facing issues with clocksettime() function to set the system clock.
>>> The input parameter to that function is the address of a  time spec structure.
>>> The values passed to tv_sec,tv_nsec are fine.
>>> But unable to set the system clock as per the values.
>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>> The function is not returning any error still its not setting the system time.
>>> Do i need to set any proccessor plag for the function to work??
>>> Is there any limitation on "tv_sec " value also??
>>> I have taken care that the time should not cross "year 2038"
>>> thwn why the function does not work???
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> QNX Momentics Community Support
>>> http://community.qnx.com/sf/go/post36153
>>>
> 

-- 
cburgess@qnx.com
RE: problem with clock_settime() function on QNX 6.4.0  
If I give 

	stime.tv_nsec = 0;
	stime.tv_sec += (60*60)*24L;  /* Add one day */
	// Set the time
	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
	{
		perror( "could not setclock" );
	}
	System("date");

Then its able to show the latest date.
If I remove System("date"); then its unable to set the new time.


Regards,
Soujanya Yelchuri

-----Original Message-----
From: Colin Burgess [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 19, 2009 8:42 PM
To: momentics-community
Subject: Re: problem with clock_settime() function on QNX 6.4.0

Ok, so to clarify

this worked on 6.3.0
it doesn't set the system clock on 6.4.0

does the date utility work (to set the clock?) - it uses clock_settime too.

Colin

soujanya Yelchuri wrote:
> 	stime.tv_nsec = 0;
> 	stime.tv_sec += (60*60)*24L;  /* Add one day */
> 	// Set the time
> 	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
> 	{
> 		perror( "could not setclock" );
> 	}
> 
> 
> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 19, 2009 8:32 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> Can you post an example of the code you are using?
> 
> soujanya Yelchuri wrote:
>> hi,
>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>> I am facing issues with clocksettime() function to set the system clock.
>> The input parameter to that function is the address of a  time spec structure.
>> The values passed to tv_sec,tv_nsec are fine.
>> But unable to set the system clock as per the values.
>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>> The function is not returning any error still its not setting the system time.
>> Do i need to set any proccessor plag for the function to work??
>> Is there any limitation on "tv_sec " value also??
>> I have taken care that the time should not cross "year 2038"
>> thwn why the function does not work???
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> QNX Momentics Community Support
>> http://community.qnx.com/sf/go/post36153
>>
> 

-- 
cburgess@qnx.com



_______________________________________________

QNX Momentics Community Support
http://community.qnx.com/sf/go/post36275


Re: problem with clock_settime() function on QNX 6.4.0  
If System("date") is showing the correct date/time then the system clock must have been set.
How are you determining that the date wasn't set correctly?

soujanya Yelchuri wrote:
> If I give 
> 
> 	stime.tv_nsec = 0;
> 	stime.tv_sec += (60*60)*24L;  /* Add one day */
> 	// Set the time
> 	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
> 	{
> 		perror( "could not setclock" );
> 	}
> 	System("date");
> 
> Then its able to show the latest date.
> If I remove System("date"); then its unable to set the new time.
> 
> 
> Regards,
> Soujanya Yelchuri
> 
> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 19, 2009 8:42 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> Ok, so to clarify
> 
> this worked on 6.3.0
> it doesn't set the system clock on 6.4.0
> 
> does the date utility work (to set the clock?) - it uses clock_settime too.
> 
> Colin
> 
> soujanya Yelchuri wrote:
>> 	stime.tv_nsec = 0;
>> 	stime.tv_sec += (60*60)*24L;  /* Add one day */
>> 	// Set the time
>> 	if( clock_settime(CLOCK_REALTIME,&stime) == -1 ) 
>> 	{
>> 		perror( "could not setclock" );
>> 	}
>>
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com] 
>> Sent: Wednesday, August 19, 2009 8:32 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Can you post an example of the code you are using?
>>
>> soujanya Yelchuri wrote:
>>> hi,
>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>> I am facing issues with clocksettime() function to set the system clock.
>>> The input parameter to that function is the address of a  time spec structure.
>>> The values passed to tv_sec,tv_nsec are fine.
>>> But unable to set the system clock as per the values.
>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>> The function is not returning any error still its not setting the system time.
>>> Do i need to set any proccessor plag for the function to work??
>>> Is there any limitation on "tv_sec " value also??
>>> I have taken care that the time should not cross "year 2038"
>>> thwn why the function does not work???
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> QNX Momentics Community Support
>>> http://community.qnx.com/sf/go/post36153
>>>
> 

-- 
cburgess@qnx.com
RE: problem with clock_settime() function on QNX 6.4.0  
if i call system("date");
after some time around 5 mins at the end of my statup 
its unable to show the time what i set..
what i mean to say is the clock_settime() function is unable to set the date and time.
if iam accessing the date immediately after setting date then its able to update the new time else no 
thats my oservation..may be wrong..


________________________________________
From: Colin Burgess [community-noreply@qnx.com]
Sent: Wednesday, August 19, 2009 8:53 PM
To: momentics-community
Subject: Re: problem with clock_settime() function on QNX 6.4.0

If System("date") is showing the correct date/time then the system clock must have been set.
How are you determining that the date wasn't set correctly?

soujanya Yelchuri wrote:
> If I give
>
>       stime.tv_nsec = 0;
>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>       // Set the time
>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>       {
>               perror( "could not setclock" );
>       }
>       System("date");
>
> Then its able to show the latest date.
> If I remove System("date"); then its unable to set the new time.
>
>
> Regards,
> Soujanya Yelchuri
>
> -----Original Message-----
> From: Colin Burgess [mailto:community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 8:42 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>
> Ok, so to clarify
>
> this worked on 6.3.0
> it doesn't set the system clock on 6.4.0
>
> does the date utility work (to set the clock?) - it uses clock_settime too.
>
> Colin
>
> soujanya Yelchuri wrote:
>>      stime.tv_nsec = 0;
>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>      // Set the time
>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>      {
>>              perror( "could not setclock" );
>>      }
>>
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:32 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Can you post an example of the code you are using?
>>
>> soujanya Yelchuri wrote:
>>> hi,
>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>> I am facing issues with clocksettime() function to set the system clock.
>>> The input parameter to that function is the address of a  time spec structure.
>>> The values passed to tv_sec,tv_nsec are fine.
>>> But unable to set the system clock as per the values.
>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>> The function is not returning any error still its not setting the system time.
>>> Do i need to set any proccessor plag for the function to work??
>>> Is there any limitation on "tv_sec " value also??
>>> I have taken care that the time should not cross "year 2038"
>>> thwn why the function does not work???
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> QNX Momentics Community Support
>>> http://community.qnx.com/sf/go/post36153
>>>
>

--
cburgess@qnx.com



_______________________________________________

QNX Momentics Community Support
http://community.qnx.com/sf/go/post36287
Re: problem with clock_settime() function on QNX 6.4.0  
Are you sure that no other app is messing with the time - because reading the clock has no affect on the system time.

soujanya Yelchuri wrote:
> if i call system("date");
> after some time around 5 mins at the end of my statup 
> its unable to show the time what i set..
> what i mean to say is the clock_settime() function is unable to set the date and time.
> if iam accessing the date immediately after setting date then its able to update the new time else no 
> thats my oservation..may be wrong..
> 
> 
> ________________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 8:53 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> If System("date") is showing the correct date/time then the system clock must have been set.
> How are you determining that the date wasn't set correctly?
> 
> soujanya Yelchuri wrote:
>> If I give
>>
>>       stime.tv_nsec = 0;
>>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>>       // Set the time
>>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>       {
>>               perror( "could not setclock" );
>>       }
>>       System("date");
>>
>> Then its able to show the latest date.
>> If I remove System("date"); then its unable to set the new time.
>>
>>
>> Regards,
>> Soujanya Yelchuri
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:42 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Ok, so to clarify
>>
>> this worked on 6.3.0
>> it doesn't set the system clock on 6.4.0
>>
>> does the date utility work (to set the clock?) - it uses clock_settime too.
>>
>> Colin
>>
>> soujanya Yelchuri wrote:
>>>      stime.tv_nsec = 0;
>>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>      // Set the time
>>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>      {
>>>              perror( "could not setclock" );
>>>      }
>>>
>>>
>>> -----Original Message-----
>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>> Sent: Wednesday, August 19, 2009 8:32 PM
>>> To: momentics-community
>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>
>>> Can you post an example of the code you are using?
>>>
>>> soujanya Yelchuri wrote:
>>>> hi,
>>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>>> I am facing issues with clocksettime() function to set the system clock.
>>>> The input parameter to that function is the address of a  time spec structure.
>>>> The values passed to tv_sec,tv_nsec are fine.
>>>> But unable to set the system clock as per the values.
>>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>>> The function is not returning any error still its not setting the system time.
>>>> Do i need to set any proccessor plag for the function to work??
>>>> Is there any limitation on "tv_sec " value also??
>>>> I have taken care that the time should not cross "year 2038"
>>>> thwn why the function does not work???
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>...
RE: problem with clock_settime() function on QNX 6.4.0  
i am sure that no other application is trying to write at the same time.

________________________________________
From: Colin Burgess [community-noreply@qnx.com]
Sent: Wednesday, August 19, 2009 10:31 PM
To: momentics-community
Subject: Re: problem with clock_settime() function on QNX 6.4.0

Are you sure that no other app is messing with the time - because reading the clock has no affect on the system time.

soujanya Yelchuri wrote:
> if i call system("date");
> after some time around 5 mins at the end of my statup
> its unable to show the time what i set..
> what i mean to say is the clock_settime() function is unable to set the date and time.
> if iam accessing the date immediately after setting date then its able to update the new time else no
> thats my oservation..may be wrong..
>
>
> ________________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 8:53 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>
> If System("date") is showing the correct date/time then the system clock must have been set.
> How are you determining that the date wasn't set correctly?
>
> soujanya Yelchuri wrote:
>> If I give
>>
>>       stime.tv_nsec = 0;
>>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>>       // Set the time
>>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>       {
>>               perror( "could not setclock" );
>>       }
>>       System("date");
>>
>> Then its able to show the latest date.
>> If I remove System("date"); then its unable to set the new time.
>>
>>
>> Regards,
>> Soujanya Yelchuri
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:42 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Ok, so to clarify
>>
>> this worked on 6.3.0
>> it doesn't set the system clock on 6.4.0
>>
>> does the date utility work (to set the clock?) - it uses clock_settime too.
>>
>> Colin
>>
>> soujanya Yelchuri wrote:
>>>      stime.tv_nsec = 0;
>>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>      // Set the time
>>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>      {
>>>              perror( "could not setclock" );
>>>      }
>>>
>>>
>>> -----Original Message-----
>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>> Sent: Wednesday, August 19, 2009 8:32 PM
>>> To: momentics-community
>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>
>>> Can you post an example of the code you are using?
>>>
>>> soujanya Yelchuri wrote:
>>>> hi,
>>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>>> I am facing issues with clocksettime() function to set the system clock.
>>>> The input parameter to that function is the address of a  time spec structure.
>>>> The values passed to tv_sec,tv_nsec are fine.
>>>> But unable to set the system clock as per the values.
>>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>>> The function is not returning any error still its not setting the system time.
>>>> Do i need to set any proccessor plag for the function to work??
>>>> Is there any limitation on "tv_sec " value also??
>>>>...
View Full Message
Re: problem with clock_settime() function on QNX 6.4.0  
Maybe not at the same time.. but maybe later...

soujanya Yelchuri wrote:
> i am sure that no other application is trying to write at the same time.
> 
> ________________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 10:31 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> Are you sure that no other app is messing with the time - because reading the clock has no affect on the system time.
> 
> soujanya Yelchuri wrote:
>> if i call system("date");
>> after some time around 5 mins at the end of my statup
>> its unable to show the time what i set..
>> what i mean to say is the clock_settime() function is unable to set the date and time.
>> if iam accessing the date immediately after setting date then its able to update the new time else no
>> thats my oservation..may be wrong..
>>
>>
>> ________________________________________
>> From: Colin Burgess [community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:53 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> If System("date") is showing the correct date/time then the system clock must have been set.
>> How are you determining that the date wasn't set correctly?
>>
>> soujanya Yelchuri wrote:
>>> If I give
>>>
>>>       stime.tv_nsec = 0;
>>>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>       // Set the time
>>>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>       {
>>>               perror( "could not setclock" );
>>>       }
>>>       System("date");
>>>
>>> Then its able to show the latest date.
>>> If I remove System("date"); then its unable to set the new time.
>>>
>>>
>>> Regards,
>>> Soujanya Yelchuri
>>>
>>> -----Original Message-----
>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>> Sent: Wednesday, August 19, 2009 8:42 PM
>>> To: momentics-community
>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>
>>> Ok, so to clarify
>>>
>>> this worked on 6.3.0
>>> it doesn't set the system clock on 6.4.0
>>>
>>> does the date utility work (to set the clock?) - it uses clock_settime too.
>>>
>>> Colin
>>>
>>> soujanya Yelchuri wrote:
>>>>      stime.tv_nsec = 0;
>>>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>>      // Set the time
>>>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>>      {
>>>>              perror( "could not setclock" );
>>>>      }
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>>> Sent: Wednesday, August 19, 2009 8:32 PM
>>>> To: momentics-community
>>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>>
>>>> Can you post an example of the code you are using?
>>>>
>>>> soujanya Yelchuri wrote:
>>>>> hi,
>>>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>>>> I am facing issues with clocksettime() function to set the system clock.
>>>>> The input parameter to that function is the address of a  time spec structure.
>>>>> The values passed to tv_sec,tv_nsec are fine.
>>>>> But unable...
View Full Message
Re: problem with clock_settime() function on QNX 6.4.0  
So basically, if I can get you to confirm...

clock_settime(CLOCK_REALTIME, &atime);
clock_gettime(CLOCK_REALTIME, &btime);

then btime makes sense (ie it reflects the update from atime, ie a date or so in the future)

whereas

clock_settime(CLOCK_REALTIME, &atime);

... wait 5 mins ...

date

does NOT show the updated time?

soujanya Yelchuri wrote:
> if i call system("date");
> after some time around 5 mins at the end of my statup 
> its unable to show the time what i set..
> what i mean to say is the clock_settime() function is unable to set the date and time.
> if iam accessing the date immediately after setting date then its able to update the new time else no 
> thats my oservation..may be wrong..
> 
> 
> ________________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 8:53 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> If System("date") is showing the correct date/time then the system clock must have been set.
> How are you determining that the date wasn't set correctly?
> 
> soujanya Yelchuri wrote:
>> If I give
>>
>>       stime.tv_nsec = 0;
>>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>>       // Set the time
>>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>       {
>>               perror( "could not setclock" );
>>       }
>>       System("date");
>>
>> Then its able to show the latest date.
>> If I remove System("date"); then its unable to set the new time.
>>
>>
>> Regards,
>> Soujanya Yelchuri
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:42 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Ok, so to clarify
>>
>> this worked on 6.3.0
>> it doesn't set the system clock on 6.4.0
>>
>> does the date utility work (to set the clock?) - it uses clock_settime too.
>>
>> Colin
>>
>> soujanya Yelchuri wrote:
>>>      stime.tv_nsec = 0;
>>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>      // Set the time
>>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>      {
>>>              perror( "could not setclock" );
>>>      }
>>>
>>>
>>> -----Original Message-----
>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>> Sent: Wednesday, August 19, 2009 8:32 PM
>>> To: momentics-community
>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>
>>> Can you post an example of the code you are using?
>>>
>>> soujanya Yelchuri wrote:
>>>> hi,
>>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>>> I am facing issues with clocksettime() function to set the system clock.
>>>> The input parameter to that function is the address of a  time spec structure.
>>>> The values passed to tv_sec,tv_nsec are fine.
>>>> But unable to set the system clock as per the values.
>>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>>> The function is not returning any error still its not setting the system time.
>>>> Do i need to set any proccessor plag for the function to work??
>>>> Is there any limitation on "tv_sec " value also??
>>>> I have taken care that the time should not cross "year...
View Full Message
RE: problem with clock_settime() function on QNX 6.4.0  
yes.

________________________________________
From: Colin Burgess [community-noreply@qnx.com]
Sent: Wednesday, August 19, 2009 10:51 PM
To: momentics-community
Subject: Re: problem with clock_settime() function on QNX 6.4.0

So basically, if I can get you to confirm...

clock_settime(CLOCK_REALTIME, &atime);
clock_gettime(CLOCK_REALTIME, &btime);

then btime makes sense (ie it reflects the update from atime, ie a date or so in the future)

whereas

clock_settime(CLOCK_REALTIME, &atime);

... wait 5 mins ...

date

does NOT show the updated time?

soujanya Yelchuri wrote:
> if i call system("date");
> after some time around 5 mins at the end of my statup
> its unable to show the time what i set..
> what i mean to say is the clock_settime() function is unable to set the date and time.
> if iam accessing the date immediately after setting date then its able to update the new time else no
> thats my oservation..may be wrong..
>
>
> ________________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 8:53 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>
> If System("date") is showing the correct date/time then the system clock must have been set.
> How are you determining that the date wasn't set correctly?
>
> soujanya Yelchuri wrote:
>> If I give
>>
>>       stime.tv_nsec = 0;
>>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>>       // Set the time
>>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>       {
>>               perror( "could not setclock" );
>>       }
>>       System("date");
>>
>> Then its able to show the latest date.
>> If I remove System("date"); then its unable to set the new time.
>>
>>
>> Regards,
>> Soujanya Yelchuri
>>
>> -----Original Message-----
>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:42 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> Ok, so to clarify
>>
>> this worked on 6.3.0
>> it doesn't set the system clock on 6.4.0
>>
>> does the date utility work (to set the clock?) - it uses clock_settime too.
>>
>> Colin
>>
>> soujanya Yelchuri wrote:
>>>      stime.tv_nsec = 0;
>>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>      // Set the time
>>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>      {
>>>              perror( "could not setclock" );
>>>      }
>>>
>>>
>>> -----Original Message-----
>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>> Sent: Wednesday, August 19, 2009 8:32 PM
>>> To: momentics-community
>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>
>>> Can you post an example of the code you are using?
>>>
>>> soujanya Yelchuri wrote:
>>>> hi,
>>>> I am migrating our application from QNX 630 to QNX 6.4.0 on PPC 8270 target.
>>>> I am facing issues with clocksettime() function to set the system clock.
>>>> The input parameter to that function is the address of a  time spec structure.
>>>> The values passed to tv_sec,tv_nsec are fine.
>>>> But unable to set the system clock as per the values.
>>>> In the QNX release notes its noted that if tv_nsec > 100 million the function will return an error EINVAL.
>>>> The function is not returning any error still its not setting the system...
View Full Message
Re: problem with clock_settime() function on QNX 6.4.0  
Ok, and what about

clock_settime()
while(1) {
	clock_gettime();
	if ( time has gone back ) {
		freakout();
	}
	sleep(1);
}

because it sure sounds like someone is resetting the date back somehow.

soujanya Yelchuri wrote:
> yes.
> 
> ________________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Wednesday, August 19, 2009 10:51 PM
> To: momentics-community
> Subject: Re: problem with clock_settime() function on QNX 6.4.0
> 
> So basically, if I can get you to confirm...
> 
> clock_settime(CLOCK_REALTIME, &atime);
> clock_gettime(CLOCK_REALTIME, &btime);
> 
> then btime makes sense (ie it reflects the update from atime, ie a date or so in the future)
> 
> whereas
> 
> clock_settime(CLOCK_REALTIME, &atime);
> 
> ... wait 5 mins ...
> 
> date
> 
> does NOT show the updated time?
> 
> soujanya Yelchuri wrote:
>> if i call system("date");
>> after some time around 5 mins at the end of my statup
>> its unable to show the time what i set..
>> what i mean to say is the clock_settime() function is unable to set the date and time.
>> if iam accessing the date immediately after setting date then its able to update the new time else no
>> thats my oservation..may be wrong..
>>
>>
>> ________________________________________
>> From: Colin Burgess [community-noreply@qnx.com]
>> Sent: Wednesday, August 19, 2009 8:53 PM
>> To: momentics-community
>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>
>> If System("date") is showing the correct date/time then the system clock must have been set.
>> How are you determining that the date wasn't set correctly?
>>
>> soujanya Yelchuri wrote:
>>> If I give
>>>
>>>       stime.tv_nsec = 0;
>>>       stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>       // Set the time
>>>       if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>       {
>>>               perror( "could not setclock" );
>>>       }
>>>       System("date");
>>>
>>> Then its able to show the latest date.
>>> If I remove System("date"); then its unable to set the new time.
>>>
>>>
>>> Regards,
>>> Soujanya Yelchuri
>>>
>>> -----Original Message-----
>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>> Sent: Wednesday, August 19, 2009 8:42 PM
>>> To: momentics-community
>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>
>>> Ok, so to clarify
>>>
>>> this worked on 6.3.0
>>> it doesn't set the system clock on 6.4.0
>>>
>>> does the date utility work (to set the clock?) - it uses clock_settime too.
>>>
>>> Colin
>>>
>>> soujanya Yelchuri wrote:
>>>>      stime.tv_nsec = 0;
>>>>      stime.tv_sec += (60*60)*24L;  /* Add one day */
>>>>      // Set the time
>>>>      if( clock_settime(CLOCK_REALTIME,&stime) == -1 )
>>>>      {
>>>>              perror( "could not setclock" );
>>>>      }
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Colin Burgess [mailto:community-noreply@qnx.com]
>>>> Sent: Wednesday, August 19, 2009 8:32 PM
>>>> To: momentics-community
>>>> Subject: Re: problem with clock_settime() function on QNX 6.4.0
>>>>
>>>> Can you post an example of the code you are using?
>>>>
>>>> soujanya Yelchuri wrote:
>>>>>...
View Full Message