| 麦田守望者's profile异想空间PhotosBlogLists | Help |
|
|
10/26/2009 与rc有关的几个重要文件OpenBSD uses an rc(8) style startup. This uses a few key files for startup.
10/22/2009 在命令行中调节音量在命令行调节音量使用mixerctl,方法如下: $ mixerctl outputs.master=200,200 其中,两个数值200,分别代表的是左右声道的音量,中间用一个逗号分隔。其取值范围是0到255。不加任何参数执行mixerctl,能够看到系统当前的音频配置参数。 把系统时间调整为本地时间By default, OpenBSD assumes your hardware clock set to UTC (Universal Coordinated Time) rather than local time, assumed by some other operating systems, which can cause problems when multi-booting. Many other operating systems, can be configured to do the same, which avoids this problem altogether. If having the hardware clock set to UTC is a problem, you can change the default behavior of OpenBSD using config(8). For example, to configure OpenBSD to use a hardware clock set to US/Eastern (5 hours behind UTC, so 300 minutes): # config -ef /bsd See options(4) and search for option "TIMEZONE=value" for more information. 以上是从OpenBSD FAQ中摘录的。config命令用于更改时区。对于北京时间,使用如下命令行修改时区: ukc> timezone -480 timezone的参数是以分钟为单位。因此,八小时为480分钟。quit之后,重启心爱的OpenBSD,date一下。看,时间变过来了。 10/21/2009 OpenBSD的rc脚本是如何工作的(摘录)The main files a system administrator should concentrate on are /etc/rc.conf (for guidance), /etc/rc.conf.local (for changes), /etc/rc.local and /etc/rc.shutdown. To get a look of how the rc(8) procedure works, here is the flow: After the kernel is booted, /etc/rc is started:
9/10/2009 对getcwd函数的一例应用的不解在OpenBSD源代码树的pwd.c中,有这样一个代码片段: int main(int argc, char *argv[]) 该段代码的目的是获得当前工作目录,并打印出来。请注意getcwd的调用方式。根据OpenBSD Maunal对getcwd函数的描述:如果给第一个参数传递NULL的话,getcwd会在某个地方分配内存空间,存放当前目录的字符串,并返回指向这个字符串的指针。调用方应该在稍后调用free,释放字符串占用的内存空间。然而,在上述从OpenBSD源代码中摘抄的代码片段,并没有调用free。 |
|
|