bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] testsuite for poll(2)


From: Yoann Vandoorselaere
Subject: Re: [PATCH] testsuite for poll(2)
Date: Fri, 12 Sep 2008 15:34:09 +0200

Le vendredi 12 septembre 2008 à 15:11 +0200, Paolo Bonzini a écrit :
> It is minimal in that it only tests one descriptor at a time.  But it
> has several tests for both sockets and pipes (and if compiled with
> -DINTERACTIVE, TTYs too), so while it does not cover a lot of code in
> the poll emulation it does cover all the subtleties.
> 
> In particular it highlighted a difference between the emulated and the
> real poll.  In the emulated one, POLLHUP is a *read* hang-up, while in
> the real one it is a write hang-up.  Unless people play subtle tricks
> with shutdown, it is not a problem, but it implies another problem in
> the emulation: to detect hang-up with the emulated poll, you have to be
> polling for POLLIN or POLLRDNORM.  This is not a major problem, either,
> but again it should be pointed out.
> 
> All tests pass on Mac OS X 10.4 (emulated) and Linux (native).

Thanks Paolo, here are a few feedback:

- enum { TRUE, FALSE } will fail to compile on WIN32, better use
stdbool, or :

#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif

- The code need to be linked to -lws2_32 to avoid undefined symbols, yet
the dependency is not pulled automatically.


After correcting the above issue, I'm still getting the following
undefined references:

i586-mingw32msvc-gcc  -g -O2   -o test-poll.exe
test-poll.o ../gllib/libgnu.a -lws2_32
test-poll.o: In function `test_pipe':
/home/yoann/dev/prelude/git/gnulib/poll/gltests/test-poll.c:347:
undefined reference to `_pipe'
test-poll.o: In function `open_server_socket':
/home/yoann/dev/prelude/git/gnulib/poll/gltests/test-poll.c:91:
undefined reference to `_inet_aton'
test-poll.o: In function `connect_to_socket':
/home/yoann/dev/prelude/git/gnulib/poll/gltests/test-poll.c:121:
undefined reference to `_inet_aton'
../gllib/libgnu.a(poll.o): In function `rpl_poll':
/home/yoann/dev/prelude/git/gnulib/poll/gllib/poll.c:154: undefined
reference to `_select_not_supported_under_win32_use_poll'


-- 
Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies
Tel: +33 (0)8 70 70 21 58                  Fax: +33(0)4 78 42 21 58
http://www.prelude-ids.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]