Linux 通配符 (*) 是在用户 Space 还是内核 Space 上实现的?
Linux Wildcard (*) is implemented on User Space or Kernel Space?
到目前为止,我已经研究过 Linux 中的通配符是一个位于 /etc/glob 中的二进制文件,或者在称为 glob() 的 C 函数中。如今,它在任何基于 Unix 的系统中都是原生的,但是,当我们输入类似以下内容时,很难理解它在哪里运行:
mv * folder
ls *
是用户space还是内核space中的运行?
这是context
这是在您给出的示例中的 shell 级别完成的,例如bash、tcsh 等。我假设他们将使用 glob(3),一个 C 库函数来完成此操作。这是严格的 user-space.
Is Kernel space used when Kernel is executing on the behalf of the user program i.e.
System Call? Or is it the address space for all the Kernel threads (for example
scheduler)?
Yes and yes.
我假设他们会使用系统调用 glob(3) 来完成此操作。系统调用发生在内核 space 中。 glob(3) 也会在内核 space.
中进行其他系统调用,例如 opendir(),也 运行
到目前为止,我已经研究过 Linux 中的通配符是一个位于 /etc/glob 中的二进制文件,或者在称为 glob() 的 C 函数中。如今,它在任何基于 Unix 的系统中都是原生的,但是,当我们输入类似以下内容时,很难理解它在哪里运行:
mv * folder
ls *
是用户space还是内核space中的运行?
这是context
这是在您给出的示例中的 shell 级别完成的,例如bash、tcsh 等。我假设他们将使用 glob(3),一个 C 库函数来完成此操作。这是严格的 user-space.
Is Kernel space used when Kernel is executing on the behalf of the user program i.e. System Call? Or is it the address space for all the Kernel threads (for example scheduler)?
Yes and yes.
我假设他们会使用系统调用 glob(3) 来完成此操作。系统调用发生在内核 space 中。 glob(3) 也会在内核 space.
中进行其他系统调用,例如 opendir(),也 运行