Skip to content

Instantly share code, notes, and snippets.

@operando
Last active August 29, 2015 14:07
Show Gist options
  • Save operando/3f255935b4d2bd023795 to your computer and use it in GitHub Desktop.
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
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;
}
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