[uClibc 0001551]: Poll with zero or negative timeout
bugs at busybox.net
bugs at busybox.net
Tue Oct 23 18:07:57 UTC 2007
The following issue has been RESOLVED.
======================================================================
http://busybox.net/bugs/view.php?id=1551
======================================================================
Reported By: jcdr
Assigned To: uClibc
======================================================================
Project: uClibc
Issue ID: 1551
Category: Standards Compliance
Reproducibility: always
Severity: block
Priority: normal
Status: resolved
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 10-23-2007 00:18 PDT
Last Modified: 10-23-2007 11:07 PDT
======================================================================
Summary: Poll with zero or negative timeout
Description:
Hello,
I tried to use the bug tracking system, but the "Report Issue" page never
go after the "Select Project" form. So I post this patch here.
The attached patch solve an issue I faced while using the libdbus-glib
waiting for a D-Bus message or the end of a glib timer at the same time.
This specific case of use generate a poll call with a zero timeout. On
platformes with the glibc a zero timeout poll return immetiately even if
there is no file descriptor event. But on platformes with uClibc a zero
timeout poll block until a file descriptor event occurs.
I found that the file libc/sysdeps/linux/common/poll.c only take care of
positive timeout and pass a null pointer in case of a zero or negative
timeout, making the zero and negative the same case: blocking.
The patch alway pass a valid structure for the timeout of poll and assign
acceptable timeout values for the zero and negative case by avoiding the
math needed for positive timeout value.
This has been tested on a Blackfin BF533 processor.
Have a good day,
--
Jean-Christian de Rivaz
======================================================================
----------------------------------------------------------------------
jcdr - 10-23-07 04:07
----------------------------------------------------------------------
Joakim Tjernlund a écrit :
> And why not pass NULL as it was before?
The man 2 ppoll say:
"If timeout is specified as NULL, then ppoll() can block indefinitely."
So you are right, it's possible to passe a null pointer to do the same as
negative value.
The poll-zero-timeout.txt patch improve this.
----------------------------------------------------------------------
jocke - 10-23-07 11:07
----------------------------------------------------------------------
fixed in uClibc trunk
Issue History
Date Modified Username Field Change
======================================================================
10-23-07 00:18 jcdr New Issue
10-23-07 00:18 jcdr Status new => assigned
10-23-07 00:18 jcdr Assigned To => uClibc
10-23-07 00:18 jcdr File Added: poll-zero-or-negative-timeout.txt
10-23-07 00:49 jcdr Issue Monitored: jcdr
10-23-07 04:06 jcdr File Added: poll-zero-timeout.txt
10-23-07 04:07 jcdr Note Added: 0002858
10-23-07 11:07 jocke Status assigned => resolved
10-23-07 11:07 jocke Resolution open => fixed
10-23-07 11:07 jocke Note Added: 0002859
======================================================================
More information about the uClibc-cvs
mailing list