Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does poll(NULL, 0, timeout) mean?

Tags:

linux

kernel

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

like image 672
FullTimeCoderPartTimeSysAdmin Avatar asked Mar 09 '26 20:03

FullTimeCoderPartTimeSysAdmin


1 Answers

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

like image 111
user207421 Avatar answered Mar 12 '26 13:03

user207421