OpenSuse(/etc/sysconfig/clock):
1.set “SYSTOHC” = "no"
2.set “HW clock”=“-u”
Ubuntu 9.10 and later (/etc/init/hwclock_save.conf):
Disable the exec line
#exec hwclock --rtc=/dev/rtc0 ......
二、接下来可以开始编写脚本了
echo "Please input your test times:"
read time
time=$time
i=0
while [ $i -lt $time ]
do
SECS=`date '+%s' -d '+2 min UTC'` # 此为将SECS设为当前2分钟以后时间
echo $SECS
echo 0 >/sys/class/rtc/rtc0/wakealarm
echo $SECS >/sys/class/rtc/rtc0/wakealarm
cat /proc/driver/rtc # 此为Linux自带检测ACPI是否成功的debug工具,若不成功则alarm time会显示例如******-04-25 10:01,成功则为如2011-04-25 10:01.
sleep 2
echo $sn >/sys/power/state # sn可设为standby(s1)、mem(s3)、disk(s4)
date
i=`expr $i \+ 1`
echo $i
done
需要解决更多linux问题,详情请看 http://www.linuxprobe.com/chapter-00.html
望采纳
不是可以直接用线程属性进行设置吗?我写了一个小程序。如下:
#include <pthread.h>
#include <limits.h>#define Thread_NUM 5void *MultiThread_soap_serve(){sleep(5) printf("new pthread!!\n")}//PTHREAD_STACK_MIN 经过计算是16K。//64*16K = 1M,线程堆栈应该是够用的。#define MICHAEL_SET_PTHREAD_STACK_SIZE 64int main(){pthread_attr_t attr pthread_attr_init(&attr) size_t stacksize = MICHAEL_SET_PTHREAD_STACK_SIZE*PTHREAD_STACK_MIN //stacksize =PTHREAD_STACK_MIN //stackaddr=(void*)malloc((N+1)*PTHREAD_STACK_MIN) //pthread_attr_getstack(&attr,&statckattr,&stacksize) //pthread_attr_setstack(&attr,stackaddr,) pthread_attr_setstacksize(&attr,stacksize) int iThreadNum = 0 pthread_t PSoapThread[Thread_NUM] for ( iThreadNum <Thread_NUM iThreadNum++ ){pthread_create(&PSoapThread[iThreadNum],&attr,MultiThread_soap_serve,(void *)NULL) }pthread_attr_destroy(&attr) while(1){sleep(10) printf("main!!\n") }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)