I'm looking at strace output that includes a call to the syscall poll():

http://man7.org/linux/man-pages/man2/poll.2.html

(This is on a Debian system, I forget kernel version.)

I keep seeing calls that look like poll(NULL, 0, intrger_here). What happens when you call poll() with pollfd set to NULL like this? Why would a program be doing this?

(I suppose I should refer to kernel source.)

share|improve this question

migrated from superuser.com 2 days ago

This question came from our site for computer enthusiasts and power users.

It is basically a longhand way of writing a sleep() of timeout duration.

share|improve this answer
   
Actually it's more a replacement for nanosleep(), but with millisecond resolution.– Murphyyesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.