Last active
August 29, 2015 14:07
-
-
Save operando/3f255935b4d2bd023795 to your computer and use it in GitHub Desktop.
【Android】adb shell date は System User or radio Groupじゃないと反映されない ref: http://qiita.com/operandoOS/items/61bbbed2568e27a6ee4e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fd = open("/dev/alarm", O_RDWR); | |
ts.tv_sec = tv.tv_sec; | |
ts.tv_nsec = tv.tv_usec * 1000; | |
res = ioctl(fd, ANDROID_ALARM_SET_RTC, &ts); | |
//res = settimeofday(&tv, NULL); | |
if(res < 0) { | |
fprintf(stderr,"settimeofday failed %s\n", strerror(errno)); | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@vbox86p:/ # ll /dev/alarm | |
crw-rw-r-- system radio 10, 54 2014-10-10 20:57 alarm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment