--- Begin Message ---
Subject: |
glibc: select() buggy on Hurd |
Date: |
Sun, 20 Mar 2005 23:23:27 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) |
Package: glibc
Version: 2.3.2.ds1-20
Coin,
Here is a simple poll() test case :
(hurd poll() directly uses hurd_select())
<quote file="poll.c">
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/poll.h>
int main(void)
{
struct pollfd pfd[1];
int fd, ret;
char c;
fd = open("zzz", O_RDONLY);
pfd[0].fd = fd;
pfd[0].events = POLLIN;
while ((ret = poll(pfd, 1, 10)) >= 0)
{
if (ret == 0)
continue;
if (pfd[0].revents & POLLERR)
break;
if (pfd[0].revents & POLLIN)
{
printf("DATA !\n");
read(fd, &c, 1);
}
}
return 0;
}
</quote>
Test :
mkfifo zzz
./poll &
echo "coin" >zzz
Result on linux :
DATA !
DATA !
DATA !
DATA !
DATA !
I've got 1 "DATA !" per character (including "\n").
Result on Hurd :
DATA !
DATA !
DATA !
DATA !
DATA !
DATA !
DATA !
[...]
I've got an infinite number of "DATA !".
It is like if the select state is not reset after reading.
I tried to find the bug but i need help, this software is not an easy peace.
Thanks.
--
Marc Dequènes (Duck)
pgp1pMO8JUqZB.pgp
Description: PGP signature
--- End Message ---