From patchwork Sun Sep 20 18:05:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dmitry V. Levin" X-Patchwork-Id: 40460 Return-Path: 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 147C63857032; Sun, 20 Sep 2020 18:05:34 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id 42B11385700C for ; Sun, 20 Sep 2020 18:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 42B11385700C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ldv@altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 343C272CA54 for ; Sun, 20 Sep 2020 21:05:30 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 27E747CFA4D; Sun, 20 Sep 2020 21:05:29 +0300 (MSK) Date: Sun, 20 Sep 2020 21:05:29 +0300 From: "Dmitry V. Levin" To: libc-alpha@sourceware.org Subject: [PATCH] linux/semctl: fix SEM_STAT_ANY support [BZ #26637] Message-ID: <20200920180529.GA1484@altlinux.org> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Handle SEM_STAT_ANY the same way as SEM_STAT so that the buffer argument of SEM_STAT_ANY is properly passed to the kernel and back. * sysdeps/unix/sysv/linux/semctl.c (semun64_to_ksemun64, semun_to_semun64, __semctl, __semctl_mode16, __old_semctl): Handle SEM_STAT_ANY. --- sysdeps/unix/sysv/linux/semctl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c index f131a26fc7..1cdabde8f2 100644 --- a/sysdeps/unix/sysv/linux/semctl.c +++ b/sysdeps/unix/sysv/linux/semctl.c @@ -102,6 +102,7 @@ semun64_to_ksemun64 (int cmd, union semun64 semun64, r.array = semun64.array; break; case SEM_STAT: + case SEM_STAT_ANY: case IPC_STAT: case IPC_SET: r.buf = buf; @@ -150,6 +151,7 @@ __semctl64 (int semid, int semnum, int cmd, ...) case IPC_STAT: /* arg.buf */ case IPC_SET: case SEM_STAT: + case SEM_STAT_ANY: case IPC_INFO: /* arg.__buf */ case SEM_INFO: va_start (ap, cmd); @@ -238,6 +240,7 @@ semun_to_semun64 (int cmd, union semun semun, struct __semid64_ds *semid64) r.array = semun.array; break; case SEM_STAT: + case SEM_STAT_ANY: case IPC_STAT: case IPC_SET: r.buf = semid64; @@ -267,6 +270,7 @@ __semctl (int semid, int semnum, int cmd, ...) case IPC_STAT: /* arg.buf */ case IPC_SET: case SEM_STAT: + case SEM_STAT_ANY: case IPC_INFO: /* arg.__buf */ case SEM_INFO: va_start (ap, cmd); @@ -321,6 +325,7 @@ __semctl_mode16 (int semid, int semnum, int cmd, ...) case IPC_STAT: /* arg.buf */ case IPC_SET: case SEM_STAT: + case SEM_STAT_ANY: case IPC_INFO: /* arg.__buf */ case SEM_INFO: va_start (ap, cmd); @@ -354,6 +359,7 @@ __old_semctl (int semid, int semnum, int cmd, ...) case IPC_STAT: /* arg.buf */ case IPC_SET: case SEM_STAT: + case SEM_STAT_ANY: case IPC_INFO: /* arg.__buf */ case SEM_INFO: va_start (ap, cmd);