首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

Linux 相助手册安装不全

2012-12-28 
Linux 帮助手册安装不全今天在新安装的 fedora 17 虚拟机上写多线程程序的时候,本想查看下系统帮助手册中

Linux 帮助手册安装不全
今天在新安装的 fedora 17 虚拟机上写多线程程序的时候,本想查看下系统帮助手册中关于线程相关函数的说明,结果。。。
[tom@localhost thread]$ man pthread_createNo manual entry for pthread_create
为啥呢?
在以下网页上找到了答案:http://blog.163.com/yungang_z/blog/static/1751531332011103103529810/
于是操作如下(安装手册):
[tom@localhost thread]$ yum install man-pages -yLoaded plugins: langpacks, presto, refresh-packagekitYou need to be root to perform this command.[tom@localhost thread]$ sudo yum install man-pages -yLoaded plugins: langpacks, presto, refresh-packagekitExisting lock /var/run/yum.pid: another copy is running as pid 6661.Another app is currently holding the yum lock; waiting for it to exit...  The other application is: PackageKit    Memory :  26 M RSS (431 MB VSZ)    Started: Sun Dec 16 17:57:33 2012 - 00:32 ago    State  : Sleeping, pid: 6661 从上面红色部分可以看到,由于 yum 锁被另一个名为 PackageKit 的进程占用,因此本安装没法继续进行,于是查出那个进程,然后 kill 掉:
[tom@localhost ~]$ ps -ef | grep packageroot      6656     1  0 17:57 ?        00:00:00 /usr/libexec/packagekitdtom       6744  6686  0 17:59 pts/0    00:00:00 grep --color=auto package[tom@localhost ~]$ kill 6656[tom@localhost ~]$ sudo kill 6656[sudo] password for tom: [tom@localhost ~]$ ps -ef | grep packagetom       6780  6686  0 18:01 pts/0    00:00:00 grep --color=auto package 
一旦该进程被 kill 成功之后,手册安装就能成功进行了:
Resolving Dependencies--> Running transaction check---> Package man-pages.noarch 0:3.35-4.fc17 will be installed--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================= Package                               Arch                               Version                                  Repository                           Size=============================================================================================================================================================Installing: man-pages                             noarch                             3.35-4.fc17                              updates                             4.9 M
Transaction Summary=============================================================================================================================================================Install  1 Package
Total download size: 4.9 MInstalled size: 4.4 MDownloading Packages:http://mirrors.ustc.edu.cn/fedora/linux/updates/17/x86_64/man-pages-3.35-4.fc17.noarch.rpm: [Errno 12] Timeout onhttp://mirrors.ustc.edu.cn/fedora/linux/updates/17/x86_64/man-pages-3.35-4.fc17.noarch.rpm: (28, '')Trying other mirror.man-pages-3.35-4.fc17.noarch.rpm                                                                                                      | 4.9 MB     00:41     Running Transaction CheckRunning Transaction TestTransaction Test SucceededRunning Transaction  Installing : man-pages-3.35-4.fc17.noarch                                                                                                              1/1   Verifying  : man-pages-3.35-4.fc17.noarch                                                                                                              1/1 
Installed:  man-pages.noarch 0:3.35-4.fc17                                                                                                                             
Complete!

再查一下相关函数的帮助,就 ok 了:
[tom@localhost thread]$ man pthread_createPTHREAD_CREATE(3)                                               Linux Programmer's Manual                                               PTHREAD_CREATE(3)
NAME       pthread_create - create a new thread
SYNOPSIS       #include <pthread.h>
       int pthread_create(pthread_t *thread, const pthread_attr_t *attr,                          void *(*start_routine) (void *), void *arg);
       Compile and link with -pthread.
DESCRIPTION       The  pthread_create()  function  starts  a new thread in the calling process.  The new thread starts execution by invoking start_routine(); arg is       passed as the sole argument of start_routine(). 

热点排行