From 5ec6a3522fb3a1ba718014441b02d03aac7e08dc Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 11 May 1999 20:09:58 +0000 Subject: [PATCH] close all open files when spawning the repeater --- src/ca/posix_depen.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/ca/posix_depen.c b/src/ca/posix_depen.c index 2997c6af2..19336763b 100644 --- a/src/ca/posix_depen.c +++ b/src/ca/posix_depen.c @@ -29,6 +29,9 @@ * Modification Log: * ----------------- * $Log$ + * Revision 1.26 1999/05/11 19:42:44 jhill + * close all open files when spawning the repeater + * * Revision 1.25 1998/08/12 16:36:54 jhill * allow the user name to change when they use su * @@ -207,6 +210,30 @@ char *localUserName() return pTmp; } +/* + * max_unix_fd() + * + * attempt to determine the maximum file descriptor + * on all UNIX systems + */ +int max_unix_fd( ) +{ + int max; + static const int bestGuess = 1024; + +# if defined(OPEN_MAX) + max = OPEN_MAX; +# elif defined(_SC_OPEN_MAX) + max = sysconf (_SC_OPEN_MAX); + if (max<0) { + max = bestGuess; + } +# else + max = bestGuess; +# endif + + return max; +} /*