From patchwork Mon Jan 2 16:44:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 89552 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp7664061qgi; Mon, 2 Jan 2017 08:45:40 -0800 (PST) X-Received: by 10.99.178.6 with SMTP id x6mr108947143pge.63.1483375540335; Mon, 02 Jan 2017 08:45:40 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w2si66168338pfg.122.2017.01.02.08.45.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 08:45:40 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76527-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-76527-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76527-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=TaisktYFyCbUmued I90fOzguusl0H6IjkN66xXV8m8CKOVz8+3v4IL1liPHF8jJv+Bmxih3P7plczZ+X 07VngTWNF18yuikl/6SdY17xJMQ/qb6UTndXS+XOKbbNhkXqr/NhKtBIQ7Why05f DZFWlbK4PcpiC4+qHwPd9IXg1+Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=YOUV82yr26FZlLvP4ZtLDn pcnHo=; b=QYsVe5eY7ikX/deXAoAIPJNU/61mvrXpzP1pX+2YnRhbS1sAos2tlt x0t8R/N8lZ+MEef3OvxL3EfeAexqrjZnhrVdFW3F8cwtt/LY+fNemhC6kCBAvWHv XmGn6VPwbOg8Sof4oLFUHZIhU80Tg7+ZX/niK0hmF5mRxLtK98NyA= Received: (qmail 38200 invoked by alias); 2 Jan 2017 16:45:21 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 14257 invoked by uid 89); 2 Jan 2017 16:45:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=powerpc32, sk:seminfo, UD:seminfo.sem_perm.__key, UD:sem_perm.__key X-HELO: mail-yw0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Bl+PwHX+9w+xKshUboIx0vzD7vSTjrWqzqTJ9MstOVk=; b=EC7KCjP84beKqPJiJrMEM+6X5MQeZ5Gm+YWtXo9b5023VGiacN970f6cz9bFinmwsI VjOgL4TBEeKTBjvYpBzx1EPxKQ9grDRdVHhYDR8v/YCFxUm9CPWLSTPhSRwhrW5uakza GT9wsryqPi1VqIjjwBWM9f7vcSIzRwNq8jKLkMNozBPGSCmT1lwtjFk417TfM8KoxAsg Izy6wtkNoaPtmYIyx6Ff3+uFCmDfLt4aXAlDmgOAijWqHBu3DSWeQRmhOmUgYtcO0tyC m5QprmLll3z9pByekR/hEZFcvl6PGD7/bLajRdG/+0rnrScPpTD2MM934wlI4GC9f6UT 8hIg== X-Gm-Message-State: AIkVDXK2c4okOsd3THOTHIU1HO9AVknOSxrc5Vo4bbP6TTZS8BD5QZTrq13BVoZSDkw+XtDU X-Received: by 10.13.198.71 with SMTP id i68mr59003534ywd.158.1483375492071; Mon, 02 Jan 2017 08:44:52 -0800 (PST) Subject: Re: [PATCH] Fix argument passing in sysvipc/test-sysvsem To: Florian Weimer , Tulio Magno Quites Machado Filho , libc-alpha@sourceware.org References: <1482847286-29933-13-git-send-email-adhemerval.zanella@linaro.org> <1483130610-2500-1-git-send-email-tuliom@linux.vnet.ibm.com> <11a5f5d5-b6af-d22b-b93e-9d8750ef927f@redhat.com> From: Adhemerval Zanella Message-ID: Date: Mon, 2 Jan 2017 14:44:47 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <11a5f5d5-b6af-d22b-b93e-9d8750ef927f@redhat.com> On 31/12/2016 07:07, Florian Weimer wrote: > On 12/30/2016 09:43 PM, Tulio Magno Quites Machado Filho wrote: >> +/* Confirm if sys/sem.h defines semun. */ >> +#ifdef _SEM_SEMUN_UNDEFINED >> +union semun >> +{ >> + int val; >> + struct semid_ds *buf; >> + unsigned short int *array; >> + struct seminfo *__buf; >> +}; >> +#endif > > Sorry, I don't understand the comment. Why is this definition not provided by the installed headers if IPC_STAT needs it? It is not really necessary to check to semun definition since we are always building the tests against a sem.h header that do not define it. I will push this fix, it should follow the correct api contract and fix the powerpc32 issue (make check at least passes on build and simulated run): diff --git a/sysvipc/test-sysvsem.c b/sysvipc/test-sysvsem.c index 92396a6..279eca9 100644 --- a/sysvipc/test-sysvsem.c +++ b/sysvipc/test-sysvsem.c @@ -55,6 +55,13 @@ do_prepare (int argc, char *argv[]) #define SEM_MODE 0644 +union semun +{ + int val; + struct semid_ds *buf; + unsigned short *array; +}; + static int do_test (void) { @@ -74,7 +81,7 @@ do_test (void) /* Get semaphore kernel information and do some sanity checks. */ struct semid_ds seminfo; - if (semctl (semid, 0, IPC_STAT, &seminfo) == -1) + if (semctl (semid, 0, IPC_STAT, (union semun) { .buf = &seminfo }) == -1) FAIL_EXIT1 ("semctl with IPC_STAT failed (errno=%d)", errno); if (seminfo.sem_perm.__key != key)