Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uOcVI-007VVa-1w for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jun 2025 13:25:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uOcVE-009Bir-6H for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Jun 2025 13:25:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uOcVD-009Bij-Sd for pgsql-hackers@lists.postgresql.org; Mon, 09 Jun 2025 13:25:28 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uOcVC-0013r4-0N for pgsql-hackers@postgresql.org; Mon, 09 Jun 2025 13:25:27 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-451d41e1ad1so33936755e9.1 for ; Mon, 09 Jun 2025 06:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749475525; x=1750080325; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:from:to:cc:subject:date :message-id:reply-to; bh=rbWrbesZYLap83yyp8ftgra5MUDvuunaYZFYtQUwfH8=; b=ApmXovO/l8FQTyYbSMqSoUKffHNUuLWK3dLiEIOPsVbHAAuxgfFx5+9QAkDj9gu9ze PAET5GTCGanCZ1kTRCB6nGpdHr92QBfpEIAy7cPgVWuf3Jf5du+FuwyUnVittUqgvYgD yDCN7EduMVKBXRuTeip8qhEBh5eoKbFUdsk1La96/TfKKV/IxYl98GcUyTPrOynwHVkf cJedD8EpBELgrhonGY248mnHF0oGXQqKb+WVBHIRcwQQaGJh4vGxJBy1MIi0LJYJgdK9 5CDJybOrdX5yZ1o5IisvKKZx0HOX/8yh8ExX9KfcMLczWZJ9ZUnTG0N/fFqyv1NahMSz OyfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749475525; x=1750080325; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rbWrbesZYLap83yyp8ftgra5MUDvuunaYZFYtQUwfH8=; b=pZxd8vh16szgouBsG42r0yRgWjsxR+XumagUDdlu+D8DQl8LjFiyp6CMoqKaK0T0se f2x1oV7TdB70nvuD17vUSJUkYKue+YpavrRRlHN4950tk60MTzyMqYLvIc9QJm4OTA3B k9EiFWCaz0PVu7dT4FpHj9nJlV+kuao7ymkexJ6SMi0/X0EeP3iKe1laVB5cJExW2l5F BmpVwutJ3swnaKKCSR1BFcVSV9golWMpCYH1jBgqg9GM9hEqUrdJlqfz2HULw7ddmIib Ptfrwp1u3brvG2rJyOb9n9yMCLJ82qRtbaXHAbNZMdtiXJE+E/6nAQj72/oS+YxQUMHz T4Jg== X-Forwarded-Encrypted: i=1; AJvYcCWZJFDooQ/QMMO9rtb+3Y/LZGknAGIwWp6zfQOI3Gt4gBynReuE65DvQQU2WxDFWLbHNrjeZxh1t2vduL26@postgresql.org X-Gm-Message-State: AOJu0YxGWwz1kEcZXU8DlakAwhehi2YiZHTvOhIHWDbShVcYZRELgeFZ PbIhxqFVQybAR9rBR5qz0aTNoX80rX64JETSS60RaVqgX2RDAsVEtngw X-Gm-Gg: ASbGnct5h30LYdnLhrfhygXogCMGmfWxRbA68rNsCfplO+NflRa/lGceJ8pSaoBIY38 sAbr2DXEFtcR9RD3VvXouMR8UTSSlM6Frho0JONK6qn2wAlXA9pJKuGKG2eObXNX2qcGnLwY1U7 4Wpayh8JpaUnnDUF8wxtJBTPj+pGxgLFSG2oMjyNceN5rcs7LmdLE/SE3gev2AKilxpxFBgezoQ QXAWmgfrSeihxnEFl0Gq/qcoAOBhsijAKXuU9iWVC8GCsXQgg9w2b+qMitLbCt9EOmB+vHbq1xB G8LExzvk17s3u+ksEAxbxCWSTpso0xarXFRKs70P0qHbRyXDh67vtmTDABp9OvsVxnR50yz/bOZ rqTD5qN1DnGlAYJ6D3wwCOs24YZOASw== X-Google-Smtp-Source: AGHT+IGEMjitXrYkbBsj8WbtaeQ643sGNloMlMJBncgFjDdiaD/JImbmSIAEI15U/8QUEIYWAZVlVg== X-Received: by 2002:a05:600c:6488:b0:43d:2313:7b49 with SMTP id 5b1f17b1804b1-45201437a5dmr129042575e9.12.1749475524345; Mon, 09 Jun 2025 06:25:24 -0700 (PDT) Received: from lightning.caipicrew.dd-dns.de ([2001:a61:aa3:d01:75c4:e686:37fd:e458]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229e014sm9537607f8f.3.2025.06.09.06.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jun 2025 06:25:23 -0700 (PDT) Message-ID: <6846e0c3.df0a0220.39ef9b.c60e@mx.google.com> X-Google-Original-Message-ID: <20250609132522.GA27427@caipicrew.dd-dns.de;lightning.caipicrew.dd-dns.de> Sender: Michael Banck Received: from mbanck by lightning.caipicrew.dd-dns.de with local (Exim 4.92) (envelope-from ) id 1uOcV8-0004kI-Sb; Mon, 09 Jun 2025 15:25:22 +0200 Date: Mon, 9 Jun 2025 15:25:22 +0200 From: Michael Banck To: Thomas Munro Cc: Tom Lane , Andres Freund , Andrew Dunstan , Robert Haas , pgsql-hackers Subject: Re: Cleaning up historical portability baggage References: <1249825.1658622186@sss.pgh.pa.us> <20220804034343.unm4rdynedbigamv@awork3.anarazel.de> <3322724.1659586159@sss.pgh.pa.us> <295419.1659918447@sss.pgh.pa.us> <747620.1660002360@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Thomas, On Thu, Aug 11, 2022 at 10:02:29PM +1200, Thomas Munro wrote: > Remove configure probe for sys/uio.h. Removing the configure probe is fine, but the patch also changes behavior in the sense that IOV_MAX is now considered defined everywhere but on Windows. However, in the good-old GNU "we have no arbitrary limits" fashion, this breaks on GNU Hurd: |gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshado |w=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -DFRONTEND -I. -I../../src/common - |I../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE -I/usr/include/libxml2\"" -DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpoin |ter-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security |-fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2\"" -DVAL_CFLAGS_SL="\"-fPIC\"" -DVAL_LDFLAGS="\"-Wl,--as-needed -Wl,-rpa |th,'/home/demo/build-farm-19.1/buildroot/REL_16_STABLE/inst/lib',--enable-new-dtags\"" -DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon -lpgport -lxslt -lxml2 - |lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lpthread -lm \"" -c -o file_utils.o file_utils.c |In file included from ../../src/include/postgres_fe.h:25, | from file_utils.c:19: |file_utils.c: In function 'pg_pwritev_with_retry': |../../src/include/port/pg_iovec.h:36:24: error: 'IOV_MAX' undeclared (first use in this function); did you mean 'INT_MAX'? | 36 | #define PG_IOV_MAX Min(IOV_MAX, 32) | | ^~~~~~~ |../../src/include/c.h:988:35: note: in definition of macro 'Min' | 988 | #define Min(x, y) ((x) < (y) ? (x) : (y)) | | ^ |file_utils.c:474:31: note: in expansion of macro 'PG_IOV_MAX' | 474 | struct iovec iov_copy[PG_IOV_MAX]; | | ^~~~~~~~~~ |../../src/include/port/pg_iovec.h:36:24: note: each undeclared identifier is reported only once for each function it appears in |$ grep IOV_MAX /usr/include/i386-gnu/bits/uio_lim.h |#undef __IOV_MAX Postgres built fine up and until v15 on the Hurd, so this is a build regression, and the fact that we define #PG_IOV_MAX to at most 32 anyway suggest we could just #definde IOV_MAX to 16 if undefined as on Windows. Christoph fixed this up for Debian's hurd-i386 builds in https://salsa.debian.org/postgresql/postgresql/-/commit/641713a4585e4b040266a1fa567b7ec90469a1bb but I have not seen a discussion about this (but might have missed it), so bringing it up here for upstream consideration in v16 and newer. Michael