man 查找函数的头文件_gcc怎么查看某个函数包含在哪个头文件及其使用方法

满意答案

dcebd7a0de6265b6ccae5ead692f1eab.png

pengye6167

2013.03.27

dcebd7a0de6265b6ccae5ead692f1eab.png

采纳率:43%    等级:13

已帮助:11627人

man 可比msdn好用多了

man 3 sleep (如果直接 man sleep ,查看的是 sleep 这个命令的手册,而不是sleep()函数的手册,你的问题应该就是由于这个导致的看错文档导致的)

就可以看到如下的说明,它明确的告诉了你需要 #include <unistd.h>,还提供了其他详细说明。

SLEEP(3)

Linux Programmer's Manual

SLEEP(3)

NAME

sleep - Sleep for the specified number of seconds

SYNOPSIS

#include <unistd.h>

unsigned int sleep(unsigned int seconds);

DESCRIPTION

sleep() makes the calling thread sleep until seconds seconds have

elapsed or a signal arrives which is not ignored.

RETURN VALUE

Zero if the requested time has elapsed, or the number of seconds left

to sleep, if the call was interrupted by a signal handler.

CONFORMING TO

POSIX.1-2001.

BUGS

sleep() may be implemented using SIGALRM; mixing calls to alarm(2) and

sleep() is a bad idea.

Using longjmp(3) from a signal handler or modifying the handling of

SIGALRM while sleeping will cause undefined results.

SEE ALSO

alarm(2), nanosleep(2), signal(2), signal(7)

COLOPHON

This page is part of release 3.25 of the Linux man-pages project. A

description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

GNU

2010-02-03

SLEEP(3)

00分享举报

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值