Return-Path: X-Original-To: rt@krbdev.mit.edu Received: from arioch.imrryr.org (arioch.imrryr.org [38.117.134.205]) by krbdev.mit.edu (Postfix) with ESMTP id 2DD0CCCF1A for ; Wed, 22 Apr 2009 04:34:53 +0000 (UTC) Received: from imrryr.org (localhost [127.0.0.1]) by arioch.imrryr.org (Postfix) with ESMTP id A49D837018 for ; Wed, 22 Apr 2009 00:34:30 -0400 (EDT) To: rt@krbdev.mit.edu Subject: Re: [krbdev.mit.edu #6317] AutoReply: select(2) if no fds < FD_SETSIZE are available. In-Reply-To: Your message of "Wed, 07 Jan 2009 21:05:54 GMT." Organization: The Fall of Imrryr User-Agent: nmh-1.0.4 (NetBSD/alpha) X-Copyright: Copyright 2009, R. C. Dowdeswell. All Rights Reserved. X-Window-System: Release 6.3 Date: Wed, 22 Apr 2009 00:34:30 -0400 From: Roland Dowdeswell Message-ID: <20090422043430.A49D837018@arioch.imrryr.org> RT-Send-Cc: X-RT-Original-Encoding: iso-8859-1 Content-Length: 1833 On 1231362354 seconds since the Beginning of the UNIX epoch "krb5" wrote: > > 2. increase the limit to DESIRED_FD_SETSIZE which I define > to be 8192. Apparently, to do this, one must also modify kdc/network.c to have the same FD_SETSIZE because it calls krb5int_cm_call_select(). This is a little counter-intuitive as the function is defined in a file called sendto_kdc.c and is marked internal. A patch is attached. This patch is suboptimal because one should either remove the dependency on krb5int_cm_call_select() or centrally define the FD_SETSIZE in another header which is included quite early. cm.h is not included early enough and putting this sort of logic in there does not work. -- Roland Dowdeswell http://Imrryr.ORG/~elric/ Index: kdc/network.c =================================================================== RCS file: /ms/dev/kerberos/mitkrb5/cvs-dirs/mitkrb5-1.4/mitkrb5/src/kdc/network.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -u -r1.8 -r1.9 --- kdc/network.c 1 Apr 2008 21:09:02 -0000 1.8 +++ kdc/network.c 11 Mar 2009 17:05:10 -0000 1.9 @@ -26,6 +26,25 @@ * Network code for Kerberos v5 KDC. */ +/* + * We start out by upping the size of FD_SETSIZE. On rational operating + * systems, this is simple. One simply #defines FD_SETSIZE before including + * anything else. Linux of course does not support this because they are + * better than that. So, we special case things... + */ + +#define DESIRED_FD_SETSIZE 8192 +#ifndef linux +#define FD_SETSIZE DESIRED_FD_SETSIZE +#else +#include +#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) +#include +#undef __FD_SETSIZE +#define __FD_SETSIZE DESIRED_FD_SETSIZE +#endif +#endif + #define NEED_SOCKETS #include "k5-int.h" #include "com_err.h"