免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2516 | 回复: 6
打印 上一主题 下一主题

要man 内核的函数,该怎么man? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-07 17:06 |只看该作者 |倒序浏览
如题?比如printk

论坛徽章:
0
2 [报告]
发表于 2008-06-07 17:14 |只看该作者

论坛徽章:
0
3 [报告]
发表于 2008-06-07 17:19 |只看该作者
一般GNU/Linux是man 2 printk
有的系统是man -k2 printk
要装好manpages-dev

论坛徽章:
0
4 [报告]
发表于 2008-06-07 17:23 |只看该作者
LS大侠,这是咋回事?
  1. root@xxx:~# man 2 printk
  2. No manual entry for printk in section 2
  3. root@xxx:~# man -k printk
  4. root@xxx:~# man -k2 printk
  5. man: invalid option -- 2
  6. Try `man --help' or `man --usage' for more information.
复制代码

manpages-dev装了
KUbuntu 8.04 KDE4 AMD64

论坛徽章:
0
5 [报告]
发表于 2008-06-07 18:28 |只看该作者
系统调用有manpages
内核函数没有man

论坛徽章:
0
6 [报告]
发表于 2008-06-07 19:28 |只看该作者
于kernel目录
make mandocs
make installmandocs

man printk

[ 本帖最后由 anhongkui 于 2008-6-7 19:33 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2008-06-07 19:33 |只看该作者
[root@antty linux-2.6.24]# man printk
Formatting page, please wait...


PRINTK(9)                  Kernel utility functions                  PRINTK(9)

NAME
       printk - print a kernel message

SYNOPSIS
       int printk (const char * fmt,  ...);

ARGUMENTS
       fmt    format string

       variable arguments

DESCRIPTION
       This is printk. It can be called from any context. We want it to work. Be aware of the fact that if
       oops_in_progress is not set, we might try to wake klogd up which could deadlock on runqueue lock if printk
       is called from scheduler code.

       We try to grab the console_sem. If we succeed, it’s easy - we log the output and call the console drivers.
       If we fail to get the semaphore we place the output into the log buffer and return. The current holder of
       the console_sem will notice the new output in release_console_sem and will send it to the consoles before
       releasing the semaphore.

       One effect of this deferred printing is that code which calls printk and then changes console_loglevel may
       break. This is because console_loglevel is inspected when the actual printing occurs.

SEE ALSO
       printf(3)

Kernel Hackers Manual 2.6.24       June 2008                         PRINTK(9)
(END)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP