简体   繁体   English

为什么在系统调用部分没有`execlp()`

[英]Why isn't `execlp()` in the system call section

I noticed that the entry for execlp() is not in the system call (2) section of the man pages, but instead resides in section (3), subroutines. 我注意到execlp()的条目不在手册页的系统调用(2)节中,而是驻留在第(3)节子例程中。 Why is this, while fork() resides in section (2)? 为什么在fork()位于第(2)节中呢?

Here are the links: 这里是链接:
https://linux.die.net/man/2/fork https://linux.die.net/man/2/fork
https://linux.die.net/man/3/execlp https://linux.die.net/man/3/execlp

Because execlp() (and all the other execXXX() functions in the same man page) is a library function wrapper around the execve() system call. 因为execlp() (以及同一手册页中的所有其他execXXX()函数)是围绕execve()系统调用的库函数包装。 The steps of collecting the variadic arguments into an array, and searching for the program in the PATH environment variable, are done in user-mode code in the library, before calling into the kernel to initiate execution of the program. 将可变参量收集到数组中并在PATH环境变量中搜索程序的步骤是在调用内核以启动程序执行之前,以库中的用户模式代码完成的。

fork() , on the other hand, simply calls directly into the kernel. 另一方面, fork()只是直接调用内核。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM