Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#3591 closed bug (fixed)

poll(NULL, 0, t)

Reported by: Adek336 Owned by: bonefish
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

#include <poll.h>
#include <stdio.h>

int main()
{
       int i = poll(NULL, 0, 2000);
       fprintf(stderr, "%d\n", i);
       return 0;
}

Haiku: immiedately prints -1 Linux, FreeBSD: sleeps for 2 seconds and prints 0

This program passes fds = NULL but at the same time, nfds = 0; so there isn't any actual null pointer dereference. The docs http://www.opengroup.org/onlinepubs/007908799/xsh/poll.html don't seem to cover this issue. I guess Haiku should follow the standard undocumented behaviour.

http://www.freelists.org/post/haiku-development/poll2-with-nfds0

Change History (3)

comment:1 by bonefish, 16 years ago

Owner: changed from axeld to bonefish
Status: newassigned

comment:2 by bonefish, 16 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev29633.

comment:3 by Adek336, 16 years ago

Thank you!

Note: See TracTickets for help on using tickets.