Which header defines the Sleep function - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: Which header defines the Sleep function (/showthread.php?tid=83775) |
Which header defines the Sleep function - Harry Muscle - 2010-10-22 I have to do some sleeping 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 - spiff - 2010-10-22 we emulate certain parts of the WINAPI. you find these bits in linux/. in this particular case it's the XTimeUtils - Harry Muscle - 2010-10-22 Cool. Thanks. Harry - jfcarroll - 2010-10-23 Harry Muscle Wrote:I have to do some sleeping 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. find . -name "*.h" -exec grep -i sleep {} /dev/null \; Welcome to Linux :-) - dbrobins - 2010-10-23 jfcarroll Wrote:find . -name "*.h" -exec grep -i sleep {} /dev/null \; 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 (Or some people might just get their IDE to tag everything.) |