From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by sourceware.org (Postfix) with ESMTPS id 2C1F0385DC0C for ; Tue, 28 Apr 2020 22:13:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2C1F0385DC0C IronPort-SDR: fshUM8YOAMGVzYUu48U1bRq2eAJW/iQ8OIgQBiF/Rwh0kvc+SUCOLl4IKrQrUi9s66H75/Q/xd 44ZDDogjZjZw1zEGDOiwjnjRWuV3SIajkFBJs/9t/w36plNf3XGOt0NSAwtmzhF/RE15xez+gJ OSiiADt8Hf0mtWSuA4J2IIrPgOslMFkUm3y9sbra9VUxToYyYkGE+4vNp8p4mqBgKT54AZtoif 9US+azJz20cAbfuWBsdZXlaNKLshw00ejOAgZugp/lcciNT3iJ+4ncNzvADhqMGla0d8xzu7d4 h2c= X-IronPort-AV: E=Sophos;i="5.73,328,1583164800"; d="scan'208";a="140766184" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 29 Apr 2020 06:13:27 +0800 IronPort-SDR: sGz5fmZ2PyLqB+GHthOX+E5w2AUgR4RzpaS7UPmWSpjxynVAER8F2puPLUhWB5hP2ZuQZaJxfr n6dd4AqKEYimthuiwYCp3tOZDoVEDVk5I= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2020 15:04:05 -0700 IronPort-SDR: ZyqFNrtWCdQ/HvWs2wB3eQmi2yALgtH/kYIy5u2vSE4+ey/+GXa3lIm5adsaCip5wVRJtR5zje hRYqSpK62HXQ== WDCIronportException: Internal Received: from cnf009918.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.56.6]) by uls-op-cesaip01.wdc.com with ESMTP; 28 Apr 2020 15:13:26 -0700 From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v6 0/3] Support y2038 semctl_syscall() Date: Tue, 28 Apr 2020 15:05:04 -0700 Message-Id: <20200428220507.3409362-1-alistair.francis@wdc.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-17.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2020 22:13:29 -0000 This series does three things: 1. Creates a bits/semid_ds_t.h file (in every arch) that specifies struct semid_ds so we no longer have to use macros defined in sem-pad.h. 2. Removes the sem-pad.h file as it is no longer needed. 3. Adds a new __semid_ds32 that is passed to the kernel (as part of a union) when running on 32-bit systems. If we are doing an IPC_STAT command then the 32-bit sem_{c,o}time{_high} values are combined to create a 64-bit value. The semctl_syscall() function passes a union semun to the kernel. The union includes struct semid_ds as a member. On 32-bit architectures the Linux kernel provides a *_high version of the 32-bit sem_otime and sem_ctime values. These can be combined to get a 64-bit version of the time. This patch adjusts the struct semid_ds to support the *_high versions of sem_otime and sem_ctime. For 32-bit systems with a 64-bit time_t this can be used to get a 64-bit time from the two 32-bit values. This series was tested by running: ./scripts/build-many-glibcs.py ... compilers ./scripts/build-many-glibcs.py ... glibcs on my x86_64 machine. I also ran make check on RV32 and I only see a total of 9 test failures. v6: - Update the 3rd patch to pass a temp buffer to the kernel v5: - Address v4 review comments - Set the semid_ds struct from a temp struct v4: - Remove the __IPC_TIME64 macro - It was only used once and doesn't work if __IPC_64 is 0 (which is usually is) - Address failures pointed out by Vineet Gupta Alistair Francis (3): bits/sem.h: Split out struct semid_ds semctl: Remove the sem-pad.h file sysv: linux: Pass 64-bit version of semctl syscall sysdeps/unix/sysv/linux/Makefile | 3 +- sysdeps/unix/sysv/linux/bits/sem.h | 26 +--------- .../sysv/linux/bits/types/struct_semid_ds.h | 46 ++++++++++++++++++ .../bits/types/struct_semid_ds.h} | 31 ++++++------ .../unix/sysv/linux/hppa/struct__semid_ds32.h | 32 +++++++++++++ .../bits/types/struct_semid_ds.h} | 20 +++++--- .../{bits/sem-pad.h => struct__semid_ds32.h} | 20 +++++--- .../unix/sysv/linux/powerpc/bits/sem-pad.h | 26 ---------- .../powerpc/bits/types/struct_semid_ds.h | 39 +++++++++++++++ .../sysv/linux/powerpc/struct__semid_ds32.h | 32 +++++++++++++ sysdeps/unix/sysv/linux/semctl.c | 47 +++++++++++++++++-- .../linux/sparc/bits/types/struct_semid_ds.h | 39 +++++++++++++++ .../sysv/linux/sparc/struct__semid_ds32.h | 32 +++++++++++++ sysdeps/unix/sysv/linux/struct__semid_ds32.h | 32 +++++++++++++ sysdeps/unix/sysv/linux/x86/bits/sem-pad.h | 24 ---------- .../bits/types/struct_semid_ds.h} | 22 ++++++--- .../unix/sysv/linux/x86/struct__semid_ds32.h | 32 +++++++++++++ 17 files changed, 389 insertions(+), 114 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h rename sysdeps/unix/sysv/linux/{bits/sem-pad.h => hppa/bits/types/struct_semid_ds.h} (51%) create mode 100644 sysdeps/unix/sysv/linux/hppa/struct__semid_ds32.h rename sysdeps/unix/sysv/linux/{sparc/bits/sem-pad.h => mips/bits/types/struct_semid_ds.h} (56%) rename sysdeps/unix/sysv/linux/mips/{bits/sem-pad.h => struct__semid_ds32.h} (52%) delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h create mode 100644 sysdeps/unix/sysv/linux/sparc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/struct__semid_ds32.h delete mode 100644 sysdeps/unix/sysv/linux/x86/bits/sem-pad.h rename sysdeps/unix/sysv/linux/{hppa/bits/sem-pad.h => x86/bits/types/struct_semid_ds.h} (53%) create mode 100644 sysdeps/unix/sysv/linux/x86/struct__semid_ds32.h -- 2.26.2