istudy0 istudy0 - 2 months ago 24
C Question

Does calling sleep() from pthread put thread to sleep or process?

I saw that there is a question about pthread sleep linux

However, when I looked up man page on my linux machine, I see the following.


unsigned int sleep(unsigned int seconds);

sleep() makes the current process sleep until seconds seconds
have elapsed or a
signal arrives which is not ignored.

So my question is that I would like to know which man page I should follow to put the thread sleep. In addition, if both are true, how can I control that?

I can probably write some code to test it but I want to make sure to hear some feedback from other people as well.

Thank you.


The wording in your man page is likely wrong. Trust the standard and trust the man page on Write to the maintainer of the documentation for your distro and tell him to update the manual pages.