Call tzset() before chroot()
来源:互联网 发布:淘宝详情页设计价格 编辑:程序博客网 时间:2024/05/01 01:47
在看lighttpd源码的时候,发现在chroot()之前调用了tzset()。由于之前都没怎么
考虑过时区的问题,所以觉得比较莫名奇妙,时区和chroot()有什么关系呢?
man tzset发现了问题所在:
If the TZ variable does not appear in the environment, the tzname vari‐
able is initialized with the best approximation of local wall clock
time, as specified by the tzfile(5)-format file localtime found in the
system timezone directory (see below). (One also often sees
/etc/localtime used here, a symlink to the right file in the system
timezone directory.
如果没有设置TZ这个环境变量的话,tzset就会根据/etc/localtime这个文件来设置,
如果chroot()之后,我们就找不到这个文件了。所以要在chroot()之前先初始化一些
与时区有关的变量。
- Call tzset() before chroot()
- WCF Before Call and After Call
- Need call beginScene before rendering
- chroot
- chroot
- chroot
- chroot
- chroot
- chroot
- chroot
- Angularjs call asynchronous before page renders
- tzset 时间环境变量
- tzset 的作用
- 时区设置函数tzset()
- gettimeofday()、tzset()与localtime()
- java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking
- java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before
- BeanFactory not initialized or already closed - call 'refresh' before access
- 在linux如何在程序中调用shell命令启动另一个程序
- matlab cell数组
- Android AsyncTask类
- Android SDK下载和更新失败的解决方法!!!
- 文件操作
- Call tzset() before chroot()
- 关于Android 虚拟机 MySQL的问题、
- Android学习笔记——关于onConfigurationChanged
- Problem of Piracy
- Android 控制台错误 应用程序获取系统权限
- 使用Jquery EasyUi常见问题解决方案
- 根据前序、中序遍历重构二叉树
- getWritableDatabase()和getReadableDatabase()方法区别
- 妙龄女子被合租男子杀害分尸