Which header defines the Sleep function
#1
I have to do some sleeping Smile in some of the code I'm writing and I know in windows you have the Sleep function (capital S), but I thought this function wasn't available in linux (instead they have sleep (small S), or usleep, or nanosleep). However, I did a quick search for Sleep (capital S) in the rest of the XBMC code and I see it's used in a handful of places like application.cpp. So it must be somehow available in Linux also.

Could anyone tell me which header defines that function (application.ccp includes so many). It would save me time in figuring it out myself.

Thanks,
Harry
Reply
#2
we emulate certain parts of the WINAPI. you find these bits in linux/. in this particular case it's the XTimeUtils
Reply
#3
Cool. Thanks.

Harry
Reply
#4
Harry Muscle Wrote:I have to do some sleeping Smile in some of the code I'm writing and I know in windows you have the Sleep function (capital S), but I thought this function wasn't available in linux (instead they have sleep (small S), or usleep, or nanosleep). However, I did a quick search for Sleep (capital S) in the rest of the XBMC code and I see it's used in a handful of places like application.cpp. So it must be somehow available in Linux also.

Could anyone tell me which header defines that function (application.ccp includes so many). It would save me time in figuring it out myself.

Thanks,
Harry

find . -name "*.h" -exec grep -i sleep {} /dev/null \;

Welcome to Linux :-)
Reply
#5
jfcarroll Wrote:find . -name "*.h" -exec grep -i sleep {} /dev/null \;

Welcome to Linux :-)

Code:
find -name '*.h' | xargs grep -i sleep

Although, since the specific function sought was Sleep with initial capital,

Code:
find -name '*.h' | xargs grep Sleep

might be better. Or if you worry about paths with spaces (looks like only the "Xbox360 Controller" folder for headers):

Code:
find -name '*.h' -print0 | xargs -0 grep Sleep

Big Grin (Or some people might just get their IDE to tag everything.)
Reply

Logout Mark Read Team Forum Stats Members Help
Which header defines the Sleep function0