centos posix函数(例如open)、pthread函数没有man手册的问题

man手册相关安装,根据系统不同,命令参数不一样

CentOS系统

[root@node0 build]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@node0 build]#

centos7 用yum -y install man-pages 安装支持posix函数的man手册。

[root@node0~]# man 2 open
OPEN(2)                    Linux Programmer's Manual                   OPEN(2)


NAME
       open, creat - open and possibly create a file or device


SYNOPSIS
       #include <sys/types.h>
       #include <sys/stat.h>
       #include <fcntl.h>


       int open(const char *pathname, int flags);
       int open(const char *pathname, int flags, mode_t mode);

Ubuntu系统

我们用man查看pthread相关函数时,发现这些函数都没有。 那是因为Ubuntu没有安装全man手册。使用下面命令进行安装:sudo apt-get install manpages-de manpages-de-dev  manpages-dev glibc-doc manpages-posix-dev manpages-posix

saber@ubuntu:~$ sudo apt-get install manpages-de manpages-de-dev  manpages-dev glibc-doc manpages-posix-dev manpages-posix
[sudo] password for saber:
Reading package lists... Done
Building dependency tree
Reading state information... Done
manpages-dev is already the newest version (4.04-2).
manpages-de is already the newest version (1.11-1).
manpages-de-dev is already the newest version (1.11-1).
manpages-posix is already the newest version (2013a-1).
manpages-posix-dev is already the newest version (2013a-1).
glibc-doc is already the newest version (2.23-0ubuntu5).
0 upgraded, 0 newly installed, 0 to remove and 322 not upgraded.
saber@ubuntu:~$ man pthread_create
PTHREAD_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);

注意:用man手册查函数的时候要输入的完整的函数名,否者帮助不出来。

saber@ubuntu:~$ man pthread
No manual entry for pthread
saber@ubuntu:~$


  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值