soujanya Yelchuri
|
problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/18/2009 8:42 AM
post36153
|
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???
|
|
|
soujanya Yelchuri
|
Re: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 6:15 AM
post36242
|
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??
|
|
|
soujanya Yelchuri
|
Re: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 8:00 AM
post36247
|
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.?
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 11:02 AM
post36269
|
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
|
|
|
soujanya Yelchuri
|
RE: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 11:07 AM
post36273
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 11:11 AM
post36275
|
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
|
|
|
soujanya Yelchuri
|
RE: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 11:13 AM
post36278
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 11:22 AM
post36286
|
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
|
|
|
soujanya Yelchuri
|
RE: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 11:15 AM
post36281
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 11:23 AM
post36287
|
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
|
|
|
soujanya Yelchuri
|
RE: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 12:50 PM
post36299
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 1:01 PM
post36301
|
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???
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>...
|
|
|
soujanya Yelchuri
|
RE: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 1:07 PM
post36303
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 1:52 PM
post36311
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 1:21 PM
post36306
|
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
|
|
|
soujanya Yelchuri
|
RE: problem with clock_settime() function on QNX 6.4.0
|
soujanya Yelchuri
08/19/2009 1:26 PM
post36308
|
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
|
|
|
Colin Burgess(deleted)
|
Re: problem with clock_settime() function on QNX 6.4.0
|
Colin Burgess(deleted)
08/19/2009 1:51 PM
post36310
|
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
|
|
|
|