public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>,
	Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>,
	libc-alpha@sourceware.org
Subject: Re: [PATCH] Fix argument passing in sysvipc/test-sysvsem
Date: Mon, 02 Jan 2017 16:45:00 -0000	[thread overview]
Message-ID: <eedde756-cd0f-d552-4534-cd71865f5b92@linaro.org> (raw)
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)

  parent reply	other threads:[~2017-01-02 16:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-27 14:02 [PATCH v5 00/17] Consolidate Linux sysvipc implementation Adhemerval Zanella
2016-12-27 14:01 ` [PATCH 01/17] Add __ASSUME_DIRECT_SYSVIPC_SYSCALL for Linux Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 06/17] Use msgget syscall for Linux implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 09/17] Use semget " Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 12/17] Add SYSV semaphore test Adhemerval Zanella
2016-12-30 20:44   ` [PATCH] Fix argument passing in sysvipc/test-sysvsem Tulio Magno Quites Machado Filho
2016-12-31  9:07     ` Florian Weimer
2016-12-31 16:05       ` Zack Weinberg
2017-01-02 16:47         ` Florian Weimer
2017-01-02 18:14           ` Tulio Magno Quites Machado Filho
2017-01-02 18:24             ` Florian Weimer
2017-01-02 16:45       ` Adhemerval Zanella [this message]
2016-12-27 14:02 ` [PATCH 15/17] Use shmdt syscall for linux implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 02/17] Refactor Linux ipc_priv header Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 16/17] Use shmget syscall for linux implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 10/17] Use semop syscall for Linux implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 08/17] Consolidate Linux semctl implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 17/17] Add SYSV shared memory test Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 03/17] Consolidate Linux msgctl implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 07/17] Add SYSV message queue test Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 05/17] Use msgsnd syscall for Linux implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 04/17] Consolidate Linux msgrcv implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 13/17] Use shmat syscall for Linux implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 11/17] Consolidate Linux semtimedop implementation Adhemerval Zanella
2016-12-27 14:02 ` [PATCH 14/17] Consolidate Linux shmctl implementation Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eedde756-cd0f-d552-4534-cd71865f5b92@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=tuliom@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).