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 1tIvFn-00HT1S-Bb for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 19:41:43 +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 1tIvFk-002Dy4-L7 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 19:41:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIvFk-002Dxw-B7 for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2024 19:41:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIvFi-0013gx-Oq for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2024 19:41:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4B4JfJiq2385948; Wed, 4 Dec 2024 14:41:19 -0500 From: Tom Lane To: Thomas Munro cc: Tomas Vondra , Peter Eisentraut , Heikki Linnakangas , Japin Li , Andres Freund , PostgreSQL Hackers Subject: Re: Cannot find a working 64-bit integer type on Illumos In-reply-to: <2276817.1733293172@sss.pgh.pa.us> References: <20240322165305.6zrtxcmzdrywvmsu@awork3.anarazel.de> <944094.1711128356@sss.pgh.pa.us> <1229869.1711160593@sss.pgh.pa.us> <7cf1dcb7-306f-4418-bf25-bdc75130db10@eisentraut.org> <0e2cc7af-f0c0-418c-b640-e5eb03eaa6e6@eisentraut.org> <50a4c05e-c43e-4e7e-95d2-4b16493073ed@eisentraut.org> <2276817.1733293172@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 04 Dec 2024 01:19:32 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2385946.1733341279.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 04 Dec 2024 14:41:19 -0500 Message-ID: <2385947.1733341279@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Also ... grison and turaco are emitting warnings that were not there a couple of days ago: grison | 2024-12-04 17:10:09 | reconstruct.c:701:33: warning: pass= ing argument 2 of 'copy_file_range' from incompatible pointer type [-Winco= mpatible-pointer-types] turaco | 2024-12-04 16:15:11 | reconstruct.c:701:61: warning: pass= ing argument 2 of 'copy_file_range' from incompatible pointer type [-Winco= mpatible-pointer-types] The code they are complaining about is from ac8110155 ("Allow using copy_file_range in write_reconstructed_file") back in April: off_t off =3D offsetmap[i]; ... wb =3D copy_file_range(s->fd, &off, wfd, NULL, BLCKSZ - nw= ritten, 0); Now, on my Linux box "man copy_file_range" saith ssize_t copy_file_range(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags); So apparently, "off_t" was the same as "loff_t" before 962da900a, but it no longer is the same on 32-bit machines. (In any case, if all machines that have copy_file_range define it like this, perhaps we ought to be declaring this variable as loff_t not off_t?) Digging a bit deeper, the full warning report is reconstruct.c: In function "write_reconstructed_file": reconstruct.c:701:33: warning: passing argument 2 of "copy_file_range" fro= m incompatible pointer type [-Wincompatible-pointer-types] wb =3D copy_file_range(s->fd, &off, wfd, NULL, BLCKSZ - nwritten, 0); ^~~~ In file included from reconstruct.c:15: /usr/include/unistd.h:1107:49: note: expected "__off64_t *" {aka "long lon= g int *"} but argument is of type "off_t *" {aka "long int *"} ssize_t copy_file_range (int __infd, __off64_t *__pinoff, ~~~~~~~~~~~^~~~~~~~ Since these are 32-bit machines, "long int" is 32 bits (confirmed from their configure results), which means "off_t" is only 32 bits, which really sounds quite broken. I thought it was 64 bits pretty much everywhere nowadays. Did 962da900a cause that? Maybe that explains the Perl library compatibility problems these machines are reporting? regards, tom lane