rtc linux - setting the time
Hi all,
I working on a RTC(linux os) project where in I have to set the current date and time.I am using ioctl for reading and setting the time.I have used the linux_rtc_time struct mentioned in man page rtc. When I use ioctl(rtc, RTC_SET_TIME, &tm) it is not giving rtc = -1. I have used struct rtc_time tm. When I checked,I got to know that to set the RTC we should set CAP_SYS_TIME capability.Can anyone help me? thanks |
Quote:
Code:
int rtc, res; /* note: two different variables */ |
rtc
Hi,
Thanks a lot for your reply.. I already have followed and used a code as you mentioned. I am getting problem in setting the time using RTC_SET_TIME and when I searched in net I got to know that we have to set the capability CAP_SYS_TIME. You can have look at MAN RTC in linux and you will get the problem I am facing. Thanks |
Quote:
Capabilities are a way of giving specific privileges to processes so they don't have to be run as root, but AFAIK a root process would still have to invoke the process to give it the capability. |
rtc
I am running in root. I only want to know a way provide the capabilities.An example code regarding this will be very helpful.
Thanks |
All times are GMT -5. The time now is 11:16 PM. |