i686-pc-linux-gnu-gcc -O2 -march=pentium-m -fomit-frame-pointer -pipe -Wstrict-prototypes -Wall -D_GNU_SOURCE rdisc.c -lresolv -o rdisc rdisc.c: In function ‘do_fork’: rdisc.c:251: error: ‘OPEN_MAX’ undeclared (first use in this function) rdisc.c:251: error: (Each undeclared identifier is reported only once rdisc.c:251: error: for each function it appears in.) make: *** [rdisc] Error 1 make: *** Waiting for unfinished jobs.... with linux-headers-2.6.23: # grep -r OPEN_MAX /usr/include/linux/ # with linux-headers-2.6.22-r2 # grep -r OPEN_MAX /usr/include/linux/ /usr/include/linux/limits.h:#define OPEN_MAX 256 /* # open files a process may have */ Portage 2.1.3.13 (default-linux/x86/2007.0/desktop, gcc-4.2.2, glibc-2.6.1-r0, 2.6.23 i686) ================================================================= System uname: 2.6.23 i686 Intel(R) Pentium(R) M processor 1600MHz Timestamp of tree: Sun, 14 Oct 2007 11:00:01 +0000 app-shells/bash: 3.2_p17-r1 dev-java/java-config: 1.3.7, 2.1.2-r1 dev-lang/python: 2.5.1-r2 dev-python/pycrypto: 2.0.1-r6 sys-apps/baselayout: 2.0.0_rc5 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61-r1 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.23 ACCEPT_KEYWORDS="x86 ~x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--nospinner" FEATURES="collision-protect cvs digest distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms sign strict unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/ http://gentoo.inode.at/" LANG="en_GB.utf8" LC_ALL="en_GB.utf8" LINGUAS="en de en_GB" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://192.168.2.1/gentoo-portage" USE="X a52 aac acl acpi alsa apache2 avahi berkdb bidi bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups curl dbus divx divx4linux dri dts dvd dvdr dvdread eds emboss encode evo exif fam ffmpeg firefox flac fortran gdbm gif gnome gnutls gpm graphviz gs gstreamer gtk hal iconv ieee1394 ipod ipv6 isdnlog java jpeg kde kdeenablefinal kerberos lcms live mad midi mikmod mmx mono mozilla mp3 mpeg mudflap ncurses nls nptl nptlonly nsplugin ntfs ogg oggvorbis openexr opengl openmp oss pam pcre pdf perl png pppd python qt qt3 qt3support qt4 quicktime readline real reflection ruby samba screen sdl session spell spl sse sse2 ssl stream svg tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb vcd vorbis win32codecs wxwindows x86 xcomposite xine xinerama xml2 xorg xprint xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev synaptics mouse keyboard" KERNEL="linux" LINGUAS="en de en_GB" USERLAND="GNU" VIDEO_CARDS="radeon" Unset: CTARGET, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
I believe this is caused by linux-headers-2.6.23 removing the OPEN_MAX definition from /usr/include/linux/limits.h. I found a random post on a random mailing list that suggested replacing the limits.h stuff with this: #include <unistd.h> #define OPEN_MAX (sysconf(_SC_OPEN_MAX)) I tried it on iputils (rdisc.c) and it seemed to fix the problem, however I'm not sure how it would act on earlier linux-headers revisions. ~ Nick
one issue per bug it's better to simply rewrite code that relies on constants ... the POSIX standard explicitly allows omitting the OPEN_MAX define as a workaround, dropping in: #define OPEN_MAX (sysconf(_SC_OPEN_MAX)) should work fine when OPEN_MAX is used dynamically and not as an actual hard constant (like an array size)
fixed in cvs
Created attachment 133584 [details, diff] Patch for removed OPEN_MAX constant in linux kernel This is a better fix for the problem (taken from http://www.redhat.com/archives/fedora-extras-commits/2007-August/msg01642.html).
*** Bug 196001 has been marked as a duplicate of this bug. ***
*** Bug 196049 has been marked as a duplicate of this bug. ***