简体   繁体   English

在glibc源代码中哪里可以找到select()源代码?

[英]where to find select() source code in glibc source?

i am trying to find the select() source code (linux, i386 arch) in the glibc source code, but i cannot find anything (related to the said architecture) 我试图在glibc源代码中找到select()源代码(Linux,i386架构),但我找不到任何东西(与所述体系结构有关)

Could anybody point me to the select() source code ? 谁能指出我的select()源代码?

mh's answer is pretty good, but I will try to be more specific: MH的答案非常好,但我会尝试更具体:

select is Linux system call, not libc function. select是Linux系统调用,不是libc函数。 It's source code could be found here . 它的源代码可以在这里找到。

libc has only wrapper for calling (executing) linux system call. libc仅具有用于调用(执行)Linux系统调用的包装器。 Wrapper for select syscall is created on the fly at build time, because select is in syscalls.list file. 由于select在syscalls.list文件中,因此将在构建时动态创建select syscall的包装。

select() is not a function of the libc, but a kernel function, so you need to take a look into the kernel source. select()不是libc的函数,而是内核函数,因此您需要查看内核源代码。

You can tell this by looking into the man page: If it is in section 2, it's a kernel function, if it's in section 3, it's a function of the standard C library, in your case the glibc. 您可以通过查看手册页来说明这一点:如果在第2节中,则为内核函数;如果在第3节中,则为标准C库的函数,在您的情况下为glibc。

Edit: Like some other people remarked correctly (thank you!), a function described in section 2 is officially called a system call and it is actually a call to a library that wraps the operating system's actual call interface. 编辑:像其他人一样,正确标记(谢谢!),第2节中描述的函数正式称为系统调用 ,它实际上是对包装了操作系统实际调用接口的库的调用。

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

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