Description of problem: gcc rdisc.c -lresolv -o rdisc rdisc.c: In function 'do_fork': rdisc.c:250: error: 'OPEN_MAX' undeclared (first use in this function) rdisc.c:250: error: (Each undeclared identifier is reported only once rdisc.c:250: error: for each function it appears in.) make: *** [rdisc] Error 1 (glibc-2.6-4) Version-Release number of selected component (if applicable): iputils-20070202-3.fc7 How reproducible: always Steps to Reproduce: 1. make 2. 3. Actual results: rdisc.c compilation fails Expected results: successful compilation Additional info: patch attached
Created attachment 160929 [details] use getrlimit instead of OPEN_MAX
Yesterday I built iputils-20070202-4.fc8 in RAWHIDE which fix this problem. Thanks for patch. I used open_max = sysconf(_SC_OPEN_MAX). Any idea what is preffered way of fixing this issue?
Using sysconf is fine, too, but it returns rlim_cur instead of rlim_max. But nobody probably cares or notices, anyways, and with sysconf you can get away with smaller number of code lines. What if returned value is RLIM_INFINITY? Then user running rdisc might want to fix his/her ulimit.
Well then I close this as duplicate and keep my patch in iputils. Thanks. *** This bug has been marked as a duplicate of 251124 ***