我试图在其中查找该getpgrp()
函数的原型,unistd.h
但找不到它。该文件中唯一包含getpgrp的行是该行libc_hidden_proto (tcgetpgrp)
,我假设这是一个宏,但我不知道它的作用。
我用谷歌搜索,但在网上找不到任何关于libc_hidden_proto
实际作用的解释。任何关于该宏在 glibc 中的用途的解释都将不胜感激。
您不小心查看了内部副本 ( include/unistd.h
) 而不是公共副本 ( posix/unistd.h
)。不,我也不明白 glibc 的源代码是如何组织的。
The following macros are used for PLT bypassing within libc.so
(and if needed other libraries similarly).
First of all, you need to have the function prototyped somewhere,
say in foo/foo.h:
int foo (int __bar);
If calls to foo within libc.so should always go to foo defined in libc.so,
then in include/foo.h you add:
libc_hidden_proto (foo)