LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: werix

脑筋急转弯儿 - 再请大家试一试

[复制链接]
发表于 2003-11-18 02:42:34 | 显示全部楼层
不明白什么叫 "不是一个\"system call\"" ???
 楼主| 发表于 2003-11-18 16:49:28 | 显示全部楼层
bouzouki,
问题问到点子上了,这也正是这个题的原意: 什么是built-in fonction? 什么是
system call?

简单的说shell 本身就是一个程序/进程,它还是一个用户跟系统之间的一个界面,
用户通过这个界面输入指令,每一个指令都是由shell 做一个fork,产生新的子进
程,在新的子进程里 执行一下execl, execlp, execle, execv, execvp,所有用execl的都是system call。还有是shell里自己的命令,这些命令不需要用execl,这就是我们所说的shell built-in fonction。 为什么cd 必是 built-in fonction呢?请看man cd (我在最后列出来了)

system call
BSD:
man -s 2 intro

linux:
man -S 2 intro  

man fork

man cd
DESCRIPTION
     directory is an absolute or relative pathname which becomes the new work-ing directory.  The interpretation of a relative pathname by cd depends on the CDPATH environment variable (see below).

     Note that cd is implemented as a built-in shell command and not as a stand-alone program.  Because each process has its own working directory,

     a separate cd utility would have no effect (it would change the directory and exit, leaving the working directory in the parent unchanged).  Different shells may implement cd with features different from those described here.  Please consult the manual for your specific shell.
发表于 2003-11-19 07:01:53 | 显示全部楼层
可问题是“system call”是系统调用的意思,无论是否是built-in都需要system call,cd就使用了chdir(),我是不明白怎么会把built-in function和system call作为一对相对的概念?
发表于 2003-11-19 07:43:01 | 显示全部楼层
概念太简单化了吧???
发表于 2003-11-20 23:16:39 | 显示全部楼层
我想版主是让大家明白,哪些命令是内部命令,哪些是外部命令。所谓built-in function是在SHELL中已经集成了的命令,而system call则是DOS下所谓的外部命令,对否?
 楼主| 发表于 2003-11-21 00:31:14 | 显示全部楼层
9 4
发表于 2003-11-21 19:35:49 | 显示全部楼层
werix版主:
你那个无痛安装贴子中的KDE包是哪里搞来的?OpenBSD光盘中并无此包啊。
 楼主| 发表于 2003-11-21 22:03:40 | 显示全部楼层
KDE's packages is in the official CD (I buy always the original CD ;) ), you can download them from any obsd mirror website.
As shown: we can easy install them with pkg_add kde*

Hope this can help you.
发表于 2003-11-22 00:46:49 | 显示全部楼层
How much does the original CD cost? and how do i get it?

I'm downloaging the kde packages from openbsd official sites now.

but which mirror site is the nearest one in our country?

Thank U.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表