getrlimit(RLIMIT_NOFILE, &x) on AIX always returns RLIM_INFINITY.
Exclude rlimit code conditionally on defined(_AIX), and return
MIN(requested_max,rlp.rlim_cur) just to be safe.
Gary Duzan
GTE Laboratories
Index: util.c
==================================================================RCS file:
/cvsroot/samba/source/lib/util.c,v
retrieving revision 1.230
diff -c -r1.230 util.c
*** util.c 1999/03/09 01:21:56 1.230
--- util.c 1999/03/10 16:08:17
***************
*** 3067,3073 ****
*****************************************************************/
int set_maxfiles(int requested_max)
{
! #if (defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE))
struct rlimit rlp;
getrlimit(RLIMIT_NOFILE, &rlp);
/* Set the fd limit to be real_max_open_files + MAX_OPEN_FUDGEFACTOR to
--- 3067,3073 ----
*****************************************************************/
int set_maxfiles(int requested_max)
{
! #if (defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) &&
!defined(_AIX))
struct rlimit rlp;
getrlimit(RLIMIT_NOFILE, &rlp);
/* Set the fd limit to be real_max_open_files + MAX_OPEN_FUDGEFACTOR to
***************
*** 3077,3083 ****
rlp.rlim_cur = MIN(requested_max,rlp.rlim_max);
setrlimit(RLIMIT_NOFILE, &rlp);
getrlimit(RLIMIT_NOFILE, &rlp);
! return rlp.rlim_cur;
#else
/*
* No way to know - just guess...
--- 3077,3083 ----
rlp.rlim_cur = MIN(requested_max,rlp.rlim_max);
setrlimit(RLIMIT_NOFILE, &rlp);
getrlimit(RLIMIT_NOFILE, &rlp);
! return MIN(requested_max,rlp.rlim_cur);
#else
/*
* No way to know - just guess...