Red Hat 9 and epoll/libevent?

Joachim Bauernberger joachim.bauernberger@friendscout24.de
Tue, 10 Feb 2004 17:18:26 +0100


Hi

I just patched a 2.4.24 kernel and am having similar problems.

Useing the instructions on:

http://epoll.hackerdojo.com/=20
=20
this site says that one should have a menuconfig option after applying the=
=20
patch under character devices.=20
However I do not see anythig that suggests CONFIG_EPOLL in the kernel confi=
g=20
after patching.=20

the following code fails in the configure script of libevent:

#include <stdint.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <sys/epoll.h>
#include <unistd.h>

int
epoll_create(int size)
{
                return (syscall(__NR_epoll_create, size));
}

int
main(int argc, char **argv)
{
                int epfd;

                        epfd =3D epoll_create(256);
                                exit (epfd =3D=3D -1 ? 1 : 0);
}

the actual failure is:

In function `epoll_create':
 `__NR_epoll_create' undeclared (first use in this function)
 (Each undeclared identifier is reported only once
 for each function it appears in.)

I didn't have time to try out 2.6.x on my testbox that runs memcached at th=
e=20
moment. I will play more with getting epoll to work once we move to=20
production

Any ideas in the meantime?

cheers,
~/joachim

On Tuesday 10 February 2004 16:53, Jamie McCarthy wrote:
> I don't use Red Hat at home so I'm not familiar with it.  Has anyone
> else had problems getting epoll support working on "Red Hat Linux
> release 9 (Shrike)"?
>
>
> uname -a:
>
> Linux foo.com 2.4.23 #2 SMP Mon Jan 19 16:38:49 PST 2004 i686 i686 i386
> GNU/Linux
>
> rpm -qi glibc:
>
> Name        : glibc                        Relocations: (not relocateable)
> Version     : 2.3.2                             Vendor: Red Hat, Inc.
> Release     : 27.9.7                        Build Date: Wed 12 Nov 2003
> 05:01:36 PM PST Install Date: Fri 14 Nov 2003 01:37:34 PM PST      Build
> Host: porky.devel.redhat.com Group       : System Environment/Libraries =
=20
> Source RPM: glibc-2.3.2-27.9.7.src.rpm
>
> ls -l /dev/epoll:
>
> crw-r--r--    1 root     root      10, 124 Jan 19 17:02 /dev/epoll
>
>
> I don't have root on this box so I have to trust that the admins
> applied the epoll kernel patch correctly.  The problem in compiling
> libevent is the same one I've seen on other boxes when the patch is
> not applied:
>
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail
>
> Anyone have any ideas?
>
>
> # ./configure
> checking for a BSD compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking whether make sets ${MAKE}... yes
> checking for working aclocal-1.4... found
> checking for working autoconf... found
> checking for working automake-1.4... found
> checking for working autoheader... found
> checking for working makeinfo... found
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking for gcc... gcc
> checking for C compiler default output... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for executable suffix...
> checking for object suffix... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for ranlib... ranlib
> checking for a BSD compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
> checking for socket in -lsocket... no
> checking how to run the C preprocessor... gcc -E
> checking for ANSI C header files... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for poll.h... yes
> checking for signal.h... yes
> checking for unistd.h... yes
> checking for sys/epoll.h... yes
> checking for sys/time.h... yes
> checking for sys/queue.h... yes
> checking for sys/event.h... no
> checking for TAILQ_FOREACH in sys/queue.h... no
> checking for timeradd in sys/time.h... yes
> checking whether time.h and sys/time.h may both be included... yes
> checking for gettimeofday... yes
> checking for select... yes
> checking for poll... yes
> checking for epoll_ctl... yes
> checking for err... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... (cached) yes
> checking for stdint.h... (cached) yes
> checking for unistd.h... (cached) yes
> checking for pid_t... yes
> checking for size_t... yes
> checking for u_int64_t... yes
> checking for u_int32_t... yes
> checking for u_int16_t... yes
> checking for u_int8_t... yes
> checking for socklen_t... yes
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating test/Makefile
> config.status: creating sample/Makefile
> config.status: creating config.h
>
> # make
> make  all-recursive
> make[1]: Entering directory `/usr/local/src/libevent-0.7c'
> Making all in .
> make[2]: Entering directory `/usr/local/src/libevent-0.7c'
> gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat    -Wall -g -O2 -c event.c
> gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat    -Wall -g -O2 -c select.c
> gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat    -Wall -g -O2 -c poll.c
> gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat    -Wall -g -O2 -c epoll.c
> gcc -DHAVE_CONFIG_H -I. -I. -I. -Icompat    -Wall -g -O2 -c signal.c
> rm -f libevent.a
> ar cru libevent.a event.o select.o poll.o epoll.o signal.o
> ranlib libevent.a
> make[2]: Leaving directory `/usr/local/src/libevent-0.7c'
> Making all in sample
> make[2]: Entering directory `/usr/local/src/libevent-0.7c/sample'
> gcc -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -c event-test.c
> gcc  -I../compat  -o event-test  event-test.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail gcc
> -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -c time-test.c
> gcc  -I../compat  -o time-test  time-test.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail gcc
> -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -c signal-test.c
> gcc  -I../compat  -o signal-test  signal-test.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail make[2]:
> Leaving directory `/usr/local/src/libevent-0.7c/sample'
> Making all in test
> make[2]: Entering directory `/usr/local/src/libevent-0.7c/test'
> gcc -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -Wall -g -O2 -c
> test-init.c gcc  -I../compat -Wall -g -O2  -o test-init  test-init.o -L..
> -levent ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail gcc
> -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -Wall -g -O2 -c test-eof.c g=
cc
>  -I../compat -Wall -g -O2  -o test-eof  test-eof.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail gcc
> -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -Wall -g -O2 -c test-weof.c
> gcc  -I../compat -Wall -g -O2  -o test-weof  test-weof.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail gcc
> -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -Wall -g -O2 -c test-time.c
> gcc  -I../compat -Wall -g -O2  -o test-time  test-time.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail gcc
> -DHAVE_CONFIG_H -I. -I. -I..     -I../compat -Wall -g -O2 -c regress.c gc=
c=20
> -I../compat -Wall -g -O2  -o regress  regress.o -L.. -levent
> ../libevent.a(epoll.o)(.text+0x5d): In function `epoll_init':
> /usr/local/src/libevent-0.7c/epoll.c:115: warning: epoll_create is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x394): In
> function `epoll_add':
> /usr/local/src/libevent-0.7c/epoll.c:274: warning: epoll_ctl is not
> implemented and will always fail ../libevent.a(epoll.o)(.text+0x1ca): In
> function `epoll_dispatch': /usr/local/src/libevent-0.7c/epoll.c:179:
> warning: epoll_wait is not implemented and will always fail Running tests:
> KQUEUE
> Skipping test
> POLL
>  test-eof: OKAY
>  test-weof: OKAY
>  test-time: OKAY
>  regress: OKAY
> SELECT
>  test-eof: OKAY
>  test-weof: OKAY
>  test-time: OKAY
>  regress: OKAY
> RTSIG
> Skipping test
> EPOLL
> Skipping test
> make[2]: Leaving directory `/usr/local/src/libevent-0.7c/test'
> make[1]: Leaving directory `/usr/local/src/libevent-0.7c'

=2D-=20
Phone: +49 (0) 89 490 267 726
=46ax: +49 (0) 89 490 267 701
Mobile: +49 (0) 179 674 3611
mailto: joachim.bauernberger@friendscout24.de =A0 =A0 =A0 =A0=20
Web: http://www.friendscout24.de