我是 Ubuntu 新手,想在操作系统中编写读写块的代码,但是当我执行命令时,man pthread
它给出了一个错误没有 pthread 的手动输入. 怎样才能解决这个问题?
答案1
首先安装这些手册页:
sudo apt-get install manpages-posix manpages-posix-dev
进而:
man pthreads
现在它应该可以工作了。
答案2
好的,您要寻找的手册页不存在:
$ man pthread
No manual entry for pthread
嗯...让我们找一些类似的东西!我们将为此
找到man
选项:-k
$ man -k pthread
pthread_attr_destroy (3) - initialize and destroy thread attributes object
pthread_attr_getaffinity_np (3) - set/get CPU affinity attribute in thread attributes object
pthread_attr_getdetachstate (3) - set/get detach state attribute in thread attributes object
pthread_attr_getguardsize (3) - set/get guard size attribute in thread attributes object
[... 47 more lines ...]
pthread_timedjoin_np (3) - try to join with a terminated thread
pthread_tryjoin_np (3) - try to join with a terminated thread
pthread_yield (3) - yield the processor
pthreads (7) - POSIX threads
vfs_aio_pthread (8) - implement async I/O in Samba vfs using a pthread pool
好的...一些相关的东西...哦!pthreads
看起来很有趣!
$ man pthreads|head -n 12
PTHREADS(7) Linux Programmer's Manual PTHREADS(7)
NAME
pthreads - POSIX threads
DESCRIPTION
POSIX.1 specifies a set of interfaces (functions, header
files) for threaded programming commonly known as POSIX
threads, or Pthreads. A single process can contain multiple
threads, all of which are executing the same program. These
现在,看起来我们找到它了!
答案3
即使我们安装了相关的man包,仍然可能会遇到“No manual entry for pthread”的情况。
在 Ubuntu 上,我们应该使用
线程管理器s (请注意粗体s)
代替
线程管理器