Red Hat Bugzilla – Bug 251408
rdisc.c does not compile because OPEN_MAX not defined
Last modified: 2007-11-30 17:12:12 EST
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
Version-Release number of selected component (if applicable):
Steps to Reproduce:
rdisc.c compilation fails
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 ***