3

我试图设置系统的时区,并尝试使用 settimeofday(),它以时区结构作为参数,但只是读到该结构现在已过时(http://linux.about.com/library /cmd/blcmdl2_settimeofday.htm)我该怎么做呢?

提前致谢。

编辑:呃,我觉得真的很愚蠢。

我创建了一个 link.c 并编译了它:

#include <stdio.h>

void main()
{
    printf("This is the link \n");
}

创建了一个 target.c,并编译它:

#include <stdio.h>

void main()
{
    printf("This is the target \n");
}

然后在测试程序中尝试了符号链接功能:

#include <unistd.h>

void main()
{
    int garbage = symlink("/home/imandhan/pythonTests/link", "/home/imandhan/pythonTests/target");
    printf(garbage);
}

由于某种原因,这给了我一个分段错误。难道我做错了什么?

4

1 回答 1

4

See tzset(3) for setting timezone for an application.

For the whole system - symlink /etc/localtime to appropriate file under /usr/share/zoneinfo/.

于 2010-08-03T18:25:26.547 回答