******** sleep **************

easonMy 2005-01-11 11:10:55
在linux下用了 sleep(3);这样的函数。编译通不过。我用man 查这个函数也没有包含什么头文件
这是怎么回事呢,应该怎么解决呢?
...全文
84 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
gaoxianfeng 2005-04-13
  • 打赏
  • 举报
回复
晕倒

你就算多加个 -S
拜托用大写
你可能没有装全开发环境 如 man文档等

man 3 sleep
SLEEP(3) Linux Programmer滻 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 current process 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.

CONFORMING TO
POSIX.1

BUGS
sleep() may be implemented using SIGALRM; mixing calls to alarm() and
sleep() is a bad idea.

Using longjmp() from a signal handler or modifying the handling of
SIGALRM while sleeping will cause undefined results.

SEE ALSO
signal(2), alarm(2)

TianNi 2005-04-13
  • 打赏
  • 举报
回复
man -s 3 sleep里也没有。
gaoxianfeng 2005-04-12
  • 打赏
  • 举报
回复
sleep是shell命令,C函数里哪有?
???

man 3 sleep
TianNi 2005-04-12
  • 打赏
  • 举报
回复
sleep是shell命令,C函数里哪有?
gaoxianfeng 2005-04-11
  • 打赏
  • 举报
回复
不是include问题
贴出有问题的代码
rainforestyu 2005-04-11
  • 打赏
  • 举报
回复
要加 include<unistd.h>

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧