freebsd-dev/tools/regression/poll/Makefile
Jilles Tjoelker 33656b91cd MFC r196460
Fix the conformance of poll(2) for sockets after r195423 by
  returning POLLHUP instead of POLLIN for several cases. Now, the
  tools/regression/poll results for FreeBSD are closer to that of the
  Solaris and Linux.

  Also, improve the POSIX conformance by explicitely clearing POLLOUT
  when POLLHUP is reported in pollscan(), making the fix global.

  Submitted by:	bde
  Reviewed by:	rwatson

MFC r196556

  Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.

  This reverts part of r196460, so that sockets only return POLLHUP if both
  directions are closed/error. Fifos get POLLHUP by closing the unused
  direction immediately after creating the sockets.

  The tools/regression/poll/*poll.c tests now pass except for two other
  things:
  - if POLLHUP is returned, POLLIN is always returned as well instead of
    only when there is data left in the buffer to be read
  - fifo old/new reader distinction does not work the way POSIX specs it

  Reviewed by:	kib, bde

MFC r196554

  Add some tests for poll(2)/shutdown(2) interaction.

Approved by:	re (kensmith)
2009-09-01 20:58:41 +00:00

37 lines
700 B
Makefile

# $FreeBSD$
# This makefile has been uglified for portability.
# Nothing yet works with gmake for the path to the sources.
.PATH: ..
PROG= pipepoll pipeselect sockpoll
CFLAGS+= -Werror -Wall
all: ${PROG}
pipepoll: pipepoll.c
pipeselect: pipeselect.c
sockpoll: sockpoll.c
pipepoll pipeselect sockpoll:
${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.c
test: all
-for prog in ${PROG}; do \
./$${prog} > $${prog}.out.new; \
diff -u1 $${prog}.out $${prog}.out.new; \
done
clean:
for prog in ${PROG}; do \
rm -f $${prog} $${prog}.out.new; \
done
rename:
for prog in ${PROG}; do \
mv $${prog}.out.new $${prog}.out; \
done
veryclean: clean
for prog in ${PROG}; do \
rm -f $${prog}.out; \
done