[v7,0/2] Support y2038 semctl_syscall()
Message ID | 20200505154736.1010242-1-alistair.francis@wdc.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23DDB3890418; Tue, 5 May 2020 15:55:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23DDB3890418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1588694157; bh=jU2Mlz8ERdcDsYjFWivmUj0roayPMD20d3GqtRDzXQg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=fFomUSZYNYBVeOzA07L3C8XC8GQ09twvxNXDKBswVslPlnZppLMRFziGsibtrbKHW EO066SkERD77C+8zvOK5zFpBRELB3vswGr6GfuW4sHCtoVr4CDubHYDCQzDAKGH5fr 9PLfC6zPd5Gyn9iW8ox/L9Ft+nLYR9l3l2to5EFs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by sourceware.org (Postfix) with ESMTPS id 6D267388F412 for <libc-alpha@sourceware.org>; Tue, 5 May 2020 15:55:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D267388F412 IronPort-SDR: BqSWC+CHO84oSPjSDMUagtR1WdEFZdqrCfwSiDwXmz9lJWTgYaPSYpwILzPSSATeHpO6pZouFq 7IG7dHkLy+9GrlTOTcd2aK4o3yaHXz7YNxboINOAClN6LcoMnFCB2+j9yvIfkWh3NNtAnHf3W9 Ege1042nwiDlFJj5n9kMGNhLPDEF8Udg089tOz8Fvjf+x5n1m62k1e88yrstSivuhHPu/DB71s rOMnfyoXwhmVe3VplMttBDgZKRetADK1kZTLul8dpp/tBrTmBf0A+VYNQZzkWBEqTmRmjPEzW+ AtQ= X-IronPort-AV: E=Sophos;i="5.73,355,1583164800"; d="scan'208";a="141312254" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 05 May 2020 23:55:54 +0800 IronPort-SDR: 8D3ITP+IprI5ddIQ8q0p3pQ890auanY18fBURVRy8zknXGMc+ZMKDS0PNLPIkQpauvJWz1cjS7 1yIQ8lHBawVCl38Qsg0oNjt0uVXy/7v5A= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 08:45:47 -0700 IronPort-SDR: vun2QcHep0l93sZdvlX61bs+BDrkBZys+I2zwRd07eQ2hQYl5QZtV6xUsG+sVpVFwbA0/02SCp 7wMTQSFqE6RA== WDCIronportException: Internal Received: from usa004641.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.56.215]) by uls-op-cesaip01.wdc.com with ESMTP; 05 May 2020 08:55:53 -0700 To: libc-alpha@sourceware.org Subject: [PATCH v7 0/2] Support y2038 semctl_syscall() Date: Tue, 5 May 2020 08:47:34 -0700 Message-Id: <20200505154736.1010242-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=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 <libc-alpha.sourceware.org> List-Unsubscribe: <http://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <http://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Alistair Francis via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Alistair Francis <alistair.francis@wdc.com> Cc: Alistair Francis <alistair.francis@wdc.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Message
Alistair Francis
May 5, 2020, 3:47 p.m. UTC
This series 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/SEM_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. v7: - Re-write based on code from Adhemerval. 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 (2): sysv: linux: Define the __semid_ds32 struct sysv: linux: Pass 64-bit version of semctl syscall bits/ipctypes.h | 10 ++ sysdeps/mips/bits/ipctypes.h | 10 ++ sysdeps/unix/sysv/linux/bits/ipc.h | 3 +- sysdeps/unix/sysv/linux/bits/sem.h | 4 +- .../unix/sysv/linux/hppa/struct__semid_ds32.h | 30 +++++ sysdeps/unix/sysv/linux/ipc_priv.h | 4 + .../unix/sysv/linux/mips/struct__semid_ds32.h | 28 ++++ .../sysv/linux/powerpc/struct__semid_ds32.h | 30 +++++ sysdeps/unix/sysv/linux/semctl.c | 121 +++++++++++++++--- .../sysv/linux/sparc/struct__semid_ds32.h | 30 +++++ sysdeps/unix/sysv/linux/struct__semid_ds32.h | 30 +++++ sysdeps/unix/sysv/linux/x86/bits/ipctypes.h | 13 ++ .../unix/sysv/linux/x86/struct__semid_ds32.h | 30 +++++ 13 files changed, 319 insertions(+), 24 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/hppa/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/mips/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/sparc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/x86/struct__semid_ds32.h