我想看看pthread_mutex_trylock的管理手册。
通过输入man pthread_mutex_trylock,我得到了No manual entry for pthread_mutex_trylock。
然后我看到一条建议做sudo apt-get install manpages-posix manpages-posix-dev的帖子。
在那之后,我看到了这样的描述:
PTHREAD_MUTEX_LOCK(3POSIX) POSIX Programmer's Manual PTHREAD_MUTEX_LOCK(3POSIX)
PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the cor‐
responding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.此接口的Linux实现可能不同(有关Linux行为的详细信息,请参阅响应cor响应的Linux手册页),或者该接口可能无法在Linux上实现。
那么,在哪里可以找到pthread_mutex_trylock的Linux实现的手册呢?我可以在我的系统上使用pthread_mutex_trylock吗?我在用Ubuntu。
发布于 2019-04-09 08:06:53
它说,因为不能保证POSIX手册(对于任何东西)都对应于特定系统上相应事物的实际实现。
要获得pthread_mutex_trylock()的手册,请安装实现接口的库的手册。
在Ubuntu系统上,所需的手册似乎是glibc-doc包的一部分(通过在Ubuntu包搜索页面上搜索函数名找到)。
POSIX手册绝对不是无用的。本地Linux接口应该与POSIX手册中描述的接口兼容,但是特定于实现的手册也可能提到特定于Linux的实现细节和扩展,以及类似的非POSIX函数。
如果您关心代码到其他Unix系统的可移植性,则POSIX手册变得尤为重要,在这种情况下,您可能希望避免依赖于POSIX规范的Linux特定扩展。
发布于 2019-12-17 02:36:14
对于Arch,包是来自man-pages的core。以fcntl为例,在安装了man-pages之后,man 2 fcntl给出了Linux程序员手册页面,而man 3 fcntl和man fcntl给出了POSIX程序员手册。
https://unix.stackexchange.com/questions/511395
复制相似问题