From patchwork Tue Jun 30 19:24:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1320097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=K6G89385; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49xDpQ0rrCz9sQt for ; Wed, 1 Jul 2020 05:25:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D810385702E; Tue, 30 Jun 2020 19:25:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D810385702E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1593545100; bh=VPfyRL65NF/R08RC1Q3vKBEPZpiSzRd0Ybb4BkZrfSg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=K6G89385mHNWj6UR/bTan3T8HQT3+bRIwp9VDoovZEs1CpBOrRqC/1eunKyYsNUtO RxL+fu0EHg/ND9iiHi9JELmAl2tPldrpPVFQDjGYyeyYyD8ecytYveqeDesuedTqIs wfvJ7CwvKeR4Juy7N87JtknW1NoXUKGp2nW+ZTm4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by sourceware.org (Postfix) with ESMTPS id 634E3385702E for ; Tue, 30 Jun 2020 19:24:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 634E3385702E Received: by mail-qt1-x844.google.com with SMTP id v19so16486384qtq.10 for ; Tue, 30 Jun 2020 12:24:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VPfyRL65NF/R08RC1Q3vKBEPZpiSzRd0Ybb4BkZrfSg=; b=KAyt3OPuY8KM9UKA9+Yad91IuEGbKzv3OGDwWaLY0D43eAJ1vyqK1UP+8sQbu1JUmq i+FRA2YfyYytqlQgkncSIGcgMCUfc52xQSM41Mrj8G490PPuDRxgBlW7IScXzIHcRQZG LOvYJ9pCXw2StJ0fdRbpDLDwX4m7DKKgoHIGQAGT/6rUYZ41iRbT7eoGNXWSQ9/QA768 zXYRSMevz3RFGBfGmPBXJxi99Ewm44/3cBMygn+ZctDMPYpeFNc9KNYJkJ3IB5y0Bvj7 pDurInD0M8LA2d+HmKP1oZu8sgcQKeSb7nYE3AUpur1IeZbOEE2noE8e5HKdXo+aQqJi LMig== X-Gm-Message-State: AOAM530kBb0NbqYnZsbf0NY2IrPDYVvJIntPTioWlSSR8Ysvzho2sV7V Yj2Iug+EsgORnxChNEdBBlTsgo40qY4= X-Google-Smtp-Source: ABdhPJwYR1BkIBcGd4ukfPzT4OrUuqZ/IjQirwpj0W8HH++kr6DH9NoERAzSMGybYCrKfgx8B5CMkA== X-Received: by 2002:ac8:4509:: with SMTP id q9mr22485257qtn.119.1593545094956; Tue, 30 Jun 2020 12:24:54 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id b7sm3558214qkl.18.2020.06.30.12.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2020 12:24:54 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 6/7] sysvipc: Remove the linux shm-pad.h file Date: Tue, 30 Jun 2020 16:24:40 -0300 Message-Id: <20200630192441.3299710-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200630192441.3299710-1-adhemerval.zanella@linaro.org> References: <20200630192441.3299710-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Cc: stepan@golosunov.pp.ru, Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Each architecture overrides the struct msqid_ds which its required kernel ABI one. Checked on x86_64-linux-gnu and some bases sysvipc tests on hppa, mips, mipsle, mips64, mips64le, sparc64, sparcv9, powerpc64le, powerpc64, and powerpc. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/bits/shm-pad.h | 37 -------------- sysdeps/unix/sysv/linux/bits/shm.h | 1 - .../sysv/linux/bits/types/struct_shmid_ds.h | 34 +++++-------- sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h | 28 ----------- .../linux/hppa/bits/types/struct_shmid_ds.h | 46 +++++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/shm-pad.h | 26 ---------- .../linux/mips/bits/types/struct_shmid_ds.h | 49 +++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/shm-pad.h | 28 ----------- .../powerpc/bits/types/struct_shmid_ds.h | 46 +++++++++++++++++ sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h | 28 ----------- .../linux/sparc/bits/types/struct_shmid_ds.h | 45 +++++++++++++++++ 12 files changed, 198 insertions(+), 172 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/bits/shm-pad.h delete mode 100644 sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h delete mode 100644 sysdeps/unix/sysv/linux/mips/bits/shm-pad.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/shm-pad.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index bdd187af73..fd0c313041 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -85,7 +85,7 @@ sysdep_headers += sys/mount.h sys/acct.h \ bits/siginfo-arch.h bits/siginfo-consts-arch.h \ bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ - bits/shmlba.h bits/shm-pad.h \ + bits/shmlba.h \ bits/termios-struct.h bits/termios-c_cc.h \ bits/termios-c_iflag.h bits/termios-c_oflag.h \ bits/termios-baud.h bits/termios-c_cflag.h \ diff --git a/sysdeps/unix/sysv/linux/bits/shm-pad.h b/sysdeps/unix/sysv/linux/bits/shm-pad.h deleted file mode 100644 index 565e0e344b..0000000000 --- a/sysdeps/unix/sysv/linux/bits/shm-pad.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Define where padding goes in struct shmid_ds. Generic version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -/* On most architectures, padding goes after time fields for 32-bit - systems and is omitted for 64-bit systems. Some architectures pad - before time fields instead, or omit padding despite being 32-bit, - or include it despite being 64-bit. Furthermore, some - architectures place shm_segsz after the time fields rather than - before them, with or without padding there. This must match the - layout used for struct shmid64_ds in , as glibc does - not do layout conversions for this structure. */ - -#define __SHM_PAD_AFTER_TIME (__TIMESIZE == 32) -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 diff --git a/sysdeps/unix/sysv/linux/bits/shm.h b/sysdeps/unix/sysv/linux/bits/shm.h index 9ef6aeaf92..f6aefa17f2 100644 --- a/sysdeps/unix/sysv/linux/bits/shm.h +++ b/sysdeps/unix/sysv/linux/bits/shm.h @@ -22,7 +22,6 @@ #include #include #include -#include /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from */ diff --git a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h index 938bbedfcd..61ed4a08c3 100644 --- a/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h +++ b/sysdeps/unix/sysv/linux/bits/types/struct_shmid_ds.h @@ -20,34 +20,22 @@ # error "Never include directly; use instead." #endif -#include - -#if __SHM_PAD_BEFORE_TIME -# define __SHM_PAD_TIME(NAME, RES) \ - unsigned long int __glibc_reserved ## RES; __time_t NAME -#elif __SHM_PAD_AFTER_TIME -# define __SHM_PAD_TIME(NAME, RES) \ - __time_t NAME; unsigned long int __glibc_reserved ## RES -#else -# define __SHM_PAD_TIME(NAME, RES) \ - __time_t NAME -#endif - /* Data structure describing a shared memory segment. */ struct shmid_ds { struct ipc_perm shm_perm; /* operation permission struct */ -#if !__SHM_SEGSZ_AFTER_TIME - size_t shm_segsz; /* size of segment in bytes */ -#endif - __SHM_PAD_TIME (shm_atime, 1); /* time of last shmat() */ - __SHM_PAD_TIME (shm_dtime, 2); /* time of last shmdt() */ - __SHM_PAD_TIME (shm_ctime, 3); /* time of last change by shmctl() */ -#if __SHM_PAD_BETWEEN_TIME_AND_SEGSZ - unsigned long int __glibc_reserved4; -#endif -#if __SHM_SEGSZ_AFTER_TIME size_t shm_segsz; /* size of segment in bytes */ +#if __TIMESIZE == 32 + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __glibc_reserved1; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __glibc_reserved2; + __time_t shm_ctime; /* time of last change by shmctl() */ + unsigned long int __glibc_reserved3; +#else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ #endif __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ diff --git a/sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h b/sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h deleted file mode 100644 index d0811fe543..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. HPPA version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) diff --git a/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h new file mode 100644 index 0000000000..1ebf222eac --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/bits/types/struct_shmid_ds.h @@ -0,0 +1,46 @@ +/* Linux/HPPA implementation of the shared memory struct shmid_ds. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never include directly; use instead." +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ +#if __TIMESIZE == 32 + unsigned long int __glibc_reserved1; + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __glibc_reserved2; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __glibc_reserved3; + __time_t shm_ctime; /* time of last change by shmctl() */ + unsigned long int __glibc_reserved4; +#else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +#endif + size_t shm_segsz; /* size of segment in bytes */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + __syscall_ulong_t __glibc_reserved5; + __syscall_ulong_t __glibc_reserved6; + }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm-pad.h b/sysdeps/unix/sysv/linux/mips/bits/shm-pad.h deleted file mode 100644 index 5a475a64f9..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/shm-pad.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Define where padding goes in struct shmid_ds. MIPS version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME 0 -#define __SHM_SEGSZ_AFTER_TIME 0 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h new file mode 100644 index 0000000000..8e13928980 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/types/struct_shmid_ds.h @@ -0,0 +1,49 @@ +/* Linux/MIPS implementation of the shared memory struct shmid_ds. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never include directly; use instead." +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ + size_t shm_segsz; /* size of segment in bytes */ +#if __TIMESIZE == 32 + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +#else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +#endif + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ +#if __TIMESIZE == 32 + unsigned short int __glibc_reserved1; + unsigned short int __glibc_reserved2; + unsigned short int __glibc_reserved3; + unsigned short int __glibc_reserved4; +#else + __syscall_ulong_t __glibc_reserved5; + __syscall_ulong_t __glibc_reserved6; +#endif + }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/shm-pad.h b/sysdeps/unix/sysv/linux/powerpc/bits/shm-pad.h deleted file mode 100644 index 34cbdb2a0d..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. PowerPC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ (__TIMESIZE == 32) diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h new file mode 100644 index 0000000000..b0816fb16a --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/types/struct_shmid_ds.h @@ -0,0 +1,46 @@ +/* Linux/PowerPC implementation of the shared memory struct shmid_ds. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never include directly; use instead." +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ +#if __TIMESIZE == 32 + unsigned long int __glibc_reserved1; + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __glibc_reserved2; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __glibc_reserved3; + __time_t shm_ctime; /* time of last change by shmctl() */ + unsigned long int __glibc_reserved4; +#else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +#endif + size_t shm_segsz; /* size of segment in bytes */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + __syscall_ulong_t __glibc_reserved5; + __syscall_ulong_t __glibc_reserved6; + }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h b/sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h deleted file mode 100644 index cd0b1fe543..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/bits/shm-pad.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Define where padding goes in struct shmid_ds. SPARC version. - Copyright (C) 2018-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_SHM_H -# error "Never use directly; include instead." -#endif - -#include - -#define __SHM_PAD_AFTER_TIME 0 -#define __SHM_PAD_BEFORE_TIME (__TIMESIZE == 32) -#define __SHM_SEGSZ_AFTER_TIME 1 -#define __SHM_PAD_BETWEEN_TIME_AND_SEGSZ 0 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h new file mode 100644 index 0000000000..d5fb61d374 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/types/struct_shmid_ds.h @@ -0,0 +1,45 @@ +/* Linux/SPARC implementation of the shared memory struct shmid_ds. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_SHM_H +# error "Never include directly; use instead." +#endif + +/* Data structure describing a shared memory segment. */ +struct shmid_ds + { + struct ipc_perm shm_perm; /* operation permission struct */ +#if __TIMESIZE == 32 + unsigned long int __glibc_reserved1; + __time_t shm_atime; /* time of last shmat() */ + unsigned long int __glibc_reserved2; + __time_t shm_dtime; /* time of last shmdt() */ + unsigned long int __glibc_reserved3; + __time_t shm_ctime; /* time of last change by shmctl() */ +#else + __time_t shm_atime; /* time of last shmat() */ + __time_t shm_dtime; /* time of last shmdt() */ + __time_t shm_ctime; /* time of last change by shmctl() */ +#endif + size_t shm_segsz; /* size of segment in bytes */ + __pid_t shm_cpid; /* pid of creator */ + __pid_t shm_lpid; /* pid of last shmop */ + shmatt_t shm_nattch; /* number of current attaches */ + __syscall_ulong_t __glibc_reserved5; + __syscall_ulong_t __glibc_reserved6; + };