By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 802 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

sleep()

P: n/a
For the life of me, I thought there was a sleep() function in the Standard
Library (or something similarly named), but I can't find it. Is it
non-existent or, if not, what header is it in?

Thanks!

Dave
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dave wrote:

For the life of me, I thought there was a sleep() function in the Standard
Library (or something similarly named), but I can't find it. Is it
non-existent or, if not, what header is it in?


There is no such thing.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 22 '05 #2

P: n/a
Dave <be***********@yahoo.com> spoke thus:
For the life of me, I thought there was a sleep() function in the Standard
Library (or something similarly named), but I can't find it. Is it
non-existent or, if not, what header is it in?


It isn't standard C - it's POSIX, I believe, which is not the same
thing.

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #3

P: n/a
"Dave" <be***********@yahoo.com> wrote in message
news:10*************@news.supernews.com...
For the life of me, I thought there was a sleep() function in the Standard
Library (or something similarly named), but I can't find it. Is it
non-existent or, if not, what header is it in?

There is not the concept of threads in C++98. It is considered a system
extension. You have to check the manual of your compiler.


Ioannis Vranos

Jul 22 '05 #4

P: n/a
Dave wrote:
For the life of me, I thought there was a sleep() function
in the Standard Library (or something similarly named),
but I can't find it.
Is it non-existent or, if not, what header is it in?


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 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)

GNU 1993-04-07 SLEEP(3)

Jul 22 '05 #5

P: n/a
In message <c5**********@ulysses.noc.ntua.gr>, Ioannis Vranos
<iv*@guesswh.at.emails.ru> writes
"Dave" <be***********@yahoo.com> wrote in message
news:10*************@news.supernews.com...
For the life of me, I thought there was a sleep() function in the Standard
Library (or something similarly named), but I can't find it. Is it
non-existent or, if not, what header is it in?

There is not the concept of threads in C++98. It is considered a system
extension. You have to check the manual of your compiler.


True, but what has that to do with the (equally non-standard,
hypothetical) sleep() function?

--
Richard Herring
Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.