On 8 July 2013 07:25, Dan Shelton <[email protected]> wrote: > I'm trying to get POLLRDHUP working in the poll command but I can't > get it working, for example if I set p[0].events.pollrdhup=true > poll(1) never sets p[0].revents.pollrdhup to true even if I'm using a > socket which has been closed by the other side. > > I dug deeper and found that the Linux binary I created from ast-ksh > 20130628 doesn't have POLLRDHUP compiled in but > src/cmd/ksh93/bltins/poll.c certainly has support for it: > ----------- > ksh -c 'poll --man 2>&1 | grep -i hup' > .pollhup > members pollhup, pollerr, and pollnval are always set to 'true' in revents > if > The pollinhup, pollnval and pollerr variables may appear in the > ${ar[x].revents.pollhup-} to get the value of ar[x].revents.pollhup > variables p[0].revents.pollin and p[0].revents.pollhup will be > 'true' > pollin="true" pollhup="true" ) ) ) ; poll -t2 p ; print -v > p' > grep RDHUP <src/cmd/ksh93/bltins/poll.c > #ifdef POLLRDHUP > { POLLRDHUP, "pollrdhup" }, > ----------- > > Can anyone check why this happens? > > Platform is Redhat Fedora 19 on a x84_64 server.
There you go. Linux only defines POLLRDHUP when you build with -D_GNU_SOURCE=1 because its an extension. Redhat doesn't do that and therefore POLLRDHUP is missing. Ced -- Cedric Blancher <[email protected]> Institute Pasteur _______________________________________________ ast-users mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-users
