Opened 11 years ago

Closed 11 years ago

Last modified 11 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


#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 don't seem to cover this issue. I guess Haiku should follow the standard undocumented behaviour.

Change History (3)

comment:1 by bonefish, 11 years ago

Owner: changed from axeld to bonefish
Status: newassigned

comment:2 by bonefish, 11 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev29633.

comment:3 by Adek336, 11 years ago

Thank you!

Note: See TracTickets for help on using tickets.