timeval에 관해 질문 드립니다.

paeksj98의 이미지

timeval 에 값을 넣고 settimeofday로 셋을 합니다.

그런뒤에 제부팅하면 값이 초기화 되네요...

초기화 되는게 정상인가요.>??

제의도는 껏다 켜두 값은 남아 있을꺼라 생각을 했는데

껏다 켯을 때도 시간 값이 남아 있는 방법(?)

시간이라는게 껏다 켜져도 항상 맞아야 하는데 정확한 원리가 먼질 모르겠네요..

시간 값을 가지고 있는걸 찾으면 될듯한데 어떤걸 찾아서 써야할지 부탁드립니다.

bushi의 이미지

참고하세요.

[bushi@rose ~]$ /sbin/hwclock --help
hwclock - query and set the hardware clock (RTC)
 
Usage: hwclock [function] [options...]
 
Functions:
  --help        show this help
  --show        read hardware clock and print result
  --set         set the rtc to the time given with --date
  --hctosys     set the system time from the hardware clock
  --systohc     set the hardware clock to the current system time
  --adjust      adjust the rtc to account for systematic drift since 
                the clock was last set or adjusted
  --getepoch    print out the kernel's hardware clock epoch value
  --setepoch    set the kernel's hardware clock epoch value to the 
                value given with --epoch
  --version     print out the version of hwclock to stdout
 
Options: 
  --utc         the hardware clock is kept in coordinated universal time
  --localtime   the hardware clock is kept in local time
  --rtc=path    special /dev/... file to use instead of default
  --directisa   access the ISA bus directly instead of /dev/rtc
  --badyear     ignore rtc's year because the bios is broken
  --date        specifies the time to which to set the hardware clock
  --epoch=year  specifies the year which is the beginning of the 
                hardware clock's epoch value
  --noadjfile   do not access /etc/adjtime. Requires the use of
                either --utc or --localtime
[bushi@rose ~]$ 

OTL