* [PATCH] ipc/sem: 64bit union semun definition
@ 2015-05-05 18:28 a22017
[not found] ` <1430850523-7522-1-git-send-email-a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: a22017 @ 2015-05-05 18:28 UTC (permalink / raw)
To: akpm, linux-api, linux-kernel; +Cc: Ling-Juan Sun
From: Ling-Juan Sun <a22017@motorola.com>
The member of semun semid_ds has new definition
semid64_ds for 64bit architectures.
Signed-off-by: Ling-Juan Sun <a22017@motorola.com>
---
include/uapi/linux/sem.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/uapi/linux/sem.h b/include/uapi/linux/sem.h
index dd73b90..e9ab2a5 100644
--- a/include/uapi/linux/sem.h
+++ b/include/uapi/linux/sem.h
@@ -50,6 +50,15 @@ union semun {
void __user *__pad;
};
+/* arg for semctl 64 bit system calls. */
+union semun64 {
+ int val; /* value for SETVAL */
+ struct semid64_ds __user *buf; /* buffer for IPC_STAT & IPC_SET */
+ unsigned short __user *array; /* array for GETALL & SETALL */
+ struct seminfo __user *__buf; /* buffer for IPC_INFO */
+ void __user *__pad;
+};
+
struct seminfo {
int semmap;
int semmni;
--
2.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1430850523-7522-1-git-send-email-a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org>]
* Re: [PATCH] ipc/sem: 64bit union semun definition [not found] ` <1430850523-7522-1-git-send-email-a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org> @ 2015-05-05 19:37 ` Arnd Bergmann [not found] ` <CACwVHNr9K0XXvB8JVEet_OtTRAJmjkHTsKsOc9h5HNts9+X5QA@mail.gmail.com> 0 siblings, 1 reply; 3+ messages in thread From: Arnd Bergmann @ 2015-05-05 19:37 UTC (permalink / raw) To: a22017-3WKxDLwmzFNWk0Htik3J/w Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tuesday 05 May 2015 11:28:43 a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org wrote: > From: Ling-Juan Sun <a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org> > > The member of semun semid_ds has new definition > semid64_ds for 64bit architectures. > > Signed-off-by: Ling-Juan Sun <a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org> > Please describe in more detail what this is needed for. The way I understood this, used space would always define union semun to define semid_ds, but that would normally match the kernel's semid64_ds. Also, what is the connection with 64-bit architectures here? Arnd ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <CACwVHNr9K0XXvB8JVEet_OtTRAJmjkHTsKsOc9h5HNts9+X5QA@mail.gmail.com>]
[parent not found: <CACwVHNr9K0XXvB8JVEet_OtTRAJmjkHTsKsOc9h5HNts9+X5QA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] ipc/sem: 64bit union semun definition [not found] ` <CACwVHNr9K0XXvB8JVEet_OtTRAJmjkHTsKsOc9h5HNts9+X5QA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2015-05-05 21:40 ` Arnd Bergmann 0 siblings, 0 replies; 3+ messages in thread From: Arnd Bergmann @ 2015-05-05 21:40 UTC (permalink / raw) To: Sandy Sun Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, linux-api-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tuesday 05 May 2015 14:09:14 Sandy Sun wrote: > Hi Arnd, > > If user space uses union semun to define.It will use semid_ds not > semid64_ds. > > I used LTP test case semctl01 IPC_STAT to do the test on 64 bit > system.According to the test results: > > Before the change, semun uses semid_ds, the field of sem_nsems reporting of > semaphore STAT info is incorrect: > > semctl01 1 TFAIL : semaphore STAT info is incorrect > semctl01 2 TFAIL : semaphore mode info is incorrect > > After this change, the return value is correct: > semctl01 1 TPASS : buf.sem_nsems and buf.sem_perm.mode are correct > semctl01 2 TPASS : buf.sem_perm.mode is correct I don't understand: semctl01 does not reference 'union semun64'. How does this change make a difference, and why would that difference be limited to 64-bit systems? Arnd ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-05 21:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05 18:28 [PATCH] ipc/sem: 64bit union semun definition a22017
[not found] ` <1430850523-7522-1-git-send-email-a22017-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org>
2015-05-05 19:37 ` Arnd Bergmann
[not found] ` <CACwVHNr9K0XXvB8JVEet_OtTRAJmjkHTsKsOc9h5HNts9+X5QA@mail.gmail.com>
[not found] ` <CACwVHNr9K0XXvB8JVEet_OtTRAJmjkHTsKsOc9h5HNts9+X5QA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-05 21:40 ` Arnd Bergmann
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 NNTP newsgroup(s).