Date: Fri, 25 Jul 1997 17:10:01 -0700 (PDT) From: Wolfgang Helbig <helbig@MX.BA-Stuttgart.De> To: freebsd-ports Subject: Re: ports/3927: xview library fails on -current and on 2.2.x Message-ID: <199707260010.RAA03547@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/3927; it has been noted by GNATS. From: Wolfgang Helbig <helbig@MX.BA-Stuttgart.De> To: asami@cs.berkeley.edu (Satoshi Asami) Cc: helbig@MX.BA-Stuttgart.De, frankd@yoda.fdt.net, freebsd-gnats-submit@hub.freebsd.org, lgk@eiche.bik-gmbh.de Subject: Re: ports/3927: xview library fails on -current and on 2.2.x Date: Sat, 26 Jul 1997 02:01:18 +0200 (MET DST) One bug fixed in xview-lib! The notifier uses FD_SETSIZE *and* getdtabelsize(2) to determine the number of FD bits. It works if FD_SETSIZE >= getdtabelsize(). The outcome of getdtabelsize() depends on the uid (on my system 360 if uid==0 and 64 if uid != 0) and on the setting of some kernel variables. This explains the erratic behaviour of the xview stuff in different environments. Following are two files to be added to /usr/ports/x11/xview-lib/patches that fix this bug. Thanks to Frank, Lars and Satoshi for insisting that there *is* a bug, for hints and tests. Wolfgang *****xview-lib/patches/patch-af***************************************** --- ../alt/lib/libxview/notify/ndet_fd.c Tue Jun 29 07:18:08 1993 +++ lib/libxview/notify/ndet_fd.c Sat Jul 26 00:42:21 1997 @@ -27,8 +27,9 @@ #define GETDTABLESIZE() \ (dtablesize_cache?dtablesize_cache:(dtablesize_cache=(int)sysconf(_SC_OPEN_MAX))) #else -#define GETDTABLESIZE() \ - (dtablesize_cache?dtablesize_cache:(dtablesize_cache=getdtablesize())) +#define GETDTABLESIZE() \ + (dtablesize_cache ? dtablesize_cache : \ + (dtablesize_cache = MIN(getdtablesize(), FD_SETSIZE))) #endif SVR4 static int ndet_fd_table_size; /* Number of descriptor slots *****EOF xview-lib/patches/patch-af***************************************** *****xview-lib/patches/patch-ag***************************************** --- ../alt/lib/libxview/notify/ndisdispch.c Tue Jun 29 07:18:06 1993 +++ lib/libxview/notify/ndisdispch.c Sat Jul 26 00:55:47 1997 @@ -30,8 +30,9 @@ #define GETDTABLESIZE() \ (dtablesize_cache?dtablesize_cache:(dtablesize_cache=(int)sysconf(_SC_OPEN_MAX))) #else -#define GETDTABLESIZE() \ - (dtablesize_cache?dtablesize_cache:(dtablesize_cache=getdtablesize())) +#define GETDTABLESIZE() \ + (dtablesize_cache ? dtablesize_cache : \ + (dtablesize_cache = MIN(getdtablesize(), FD_SETSIZE))) #endif SVR4 pkg_private_data u_int ndis_flags = 0; *****EOF xview-lib/patches/patch-ag*****************************************
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707260010.RAA03547>