Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzZLv-0006kf-MQ for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Aug 2019 04:33:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hzZLu-0002F9-6e for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Aug 2019 04:33:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzZLt-0002F2-V3 for pgsql-bugs@lists.postgresql.org; Mon, 19 Aug 2019 04:33:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzZLn-0001ae-DL for pgsql-bugs@lists.postgresql.org; Mon, 19 Aug 2019 04:33:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x7J4Wp9G023515; Mon, 19 Aug 2019 00:32:51 -0400 From: Tom Lane To: Michael Paquier cc: Alvaro Herrera , Andres Freund , Dilip Kumar , jungleboogie0@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclared identifier 'FD_SETSIZE' In-reply-to: <20190819042832.GA1702@paquier.xyz> References: <20190818001858.ho3ev4z57fqhs7a5@alap3.anarazel.de> <20190819025953.GA15110@alvherre.pgsql> <20190819042832.GA1702@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Mon, 19 Aug 2019 13:28:32 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23513.1566189171.1@sss.pgh.pa.us> Date: Mon, 19 Aug 2019 00:32:51 -0400 Message-ID: <23514.1566189171@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Sun, Aug 18, 2019 at 10:59:54PM -0400, Alvaro Herrera wrote: >> So I agree that we need a fix. > How would you detect how many fds can be opened by a user in this > case? I think Andres' suggestion is probably fine: don't try to detect it in advance. Just open the files, and error out if we need to put an fd index >= FD_SETSIZE into an fd_set. It'll be a shade less user-friendly, in that the program might run for a bit before failing; but I doubt that such cases arise often enough to be worth working harder. regards, tom lane