Opened 10 years ago

Closed 10 years ago

Last modified 10 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:
Has a Patch: no 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 Changed 10 years ago by bonefish

Owner: changed from axeld to bonefish
Status: newassigned

comment:2 Changed 10 years ago by bonefish

Resolution: fixed
Status: assignedclosed

Fixed in hrev29633.

comment:3 Changed 10 years ago by Adek336

Thank you!

Note: See TracTickets for help on using tickets.