什么是通过使用STIME()和clock_settime()设置? [英] What is set by using stime() and clock_settime()?

查看:1268
本文介绍了什么是通过使用STIME()和clock_settime()设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这时钟使用STIME()和clock_settime()设置?正如我在阅读的人都可以设置一个Linux的时间。功能STIME()设置)的时间观念和clock_settime(有参数CLOCK_REALTIME可以设置一个全系统RTC。

Which clock is set by using stime() and clock_settime()? As I can read in man both can set a Linux time. Function stime() sets "the idea of time" and clock_settime() with parameter CLOCK_REALTIME can set a "system wide RTC".

1)什么是这些时钟?结果
2)有什么区别?结果
3)他们还设置了硬件时钟?结果
4)如果不是:是否有人知道一个聪明的办法来设置在C / C ++的hwclock的不使用的ioctl()

1) What are these clocks?
2) Are there any differences?
3) Do they also set the HW clock?
4) If not: Does anybody know a smart way to set the hwclock in C/C++ without using ioctl()?

[更新1]结果
更具体点4:什么是C相当于的std ::系统(/ sbin目录/ hwclock的-w)

推荐答案

对不起这个简短的回答我其​​实只想做一个评论,但它不会让我说。

Sorry for this short answer i actually just wanted to do a comment, but it wont allow me that.

好帮你关于你的第4个问题。
在谷歌一些快速研究派我来
https://github.com/karelzak/util-linux /blob/master/sys-utils/hwclock.c
我还没有研究过这个code超过2分钟,但快速搜索显示行468:

Well to help you about your question 4. Some quick research on Google sent me to https://github.com/karelzak/util-linux/blob/master/sys-utils/hwclock.c I havent studied this code more than 2 minutes but a quick search showed line 468:


静态无效set_hardware_clock(常量time_t的NEWTIME,常量布尔普遍,常量布尔测试)

编辑:

BTW退房的维基百科为它 http://en.wikipedia.org/wiki/Util -linux
和人RTC

BTW Check out the wikipedia for it http://en.wikipedia.org/wiki/Util-linux and man rtc

这篇关于什么是通过使用STIME()和clock_settime()设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆