linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uapi: fix asm/ipcbuf.h userspace compilation errors
@ 2017-02-26 18:29 Dmitry V. Levin
  2017-02-26 18:29 ` Dmitry V. Levin
  2017-03-01 16:23 ` Arnd Bergmann
  0 siblings, 2 replies; 28+ messages in thread
From: Dmitry V. Levin @ 2017-02-26 18:29 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Martin Schwidefsky, Heiko Carstens, David S. Miller, Chris Zankel,
	Max Filippov, linux-arch, linux-s390, sparclinux, linux-xtensa,
	linux-kernel

Include <linux/posix_types.h> to fix asm/ipcbuf.h userspace compilation
errors like this:

/usr/include/asm-generic/ipcbuf.h:20:2: error: unknown type name '__kernel_key_t'
  __kernel_key_t  key;
/usr/include/asm-generic/ipcbuf.h:21:2: error: unknown type name '__kernel_uid32_t'
  __kernel_uid32_t uid;
/usr/include/asm-generic/ipcbuf.h:22:2: error: unknown type name '__kernel_gid32_t'
  __kernel_gid32_t gid;
/usr/include/asm-generic/ipcbuf.h:23:2: error: unknown type name '__kernel_uid32_t'
  __kernel_uid32_t cuid;
/usr/include/asm-generic/ipcbuf.h:24:2: error: unknown type name '__kernel_gid32_t'
  __kernel_gid32_t cgid;
/usr/include/asm-generic/ipcbuf.h:25:2: error: unknown type name '__kernel_mode_t'
  __kernel_mode_t  mode;
/usr/include/asm-generic/ipcbuf.h:27:35: error: '__kernel_mode_t' undeclared here (not in a function)
  unsigned char  __pad1[4 - sizeof(__kernel_mode_t)];
/usr/include/asm-generic/ipcbuf.h:30:2: error: unknown type name '__kernel_ulong_t'
  __kernel_ulong_t __unused1;
/usr/include/asm-generic/ipcbuf.h:31:2: error: unknown type name '__kernel_ulong_t'
  __kernel_ulong_t __unused2;

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/asm-generic/ipcbuf.h     | 2 ++
 arch/s390/include/uapi/asm/ipcbuf.h   | 2 ++
 arch/sparc/include/uapi/asm/ipcbuf.h  | 2 ++
 arch/xtensa/include/uapi/asm/ipcbuf.h | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/include/uapi/asm-generic/ipcbuf.h b/include/uapi/asm-generic/ipcbuf.h
index 3dbcc1e..909f825 100644
--- a/include/uapi/asm-generic/ipcbuf.h
+++ b/include/uapi/asm-generic/ipcbuf.h
@@ -1,6 +1,8 @@
 #ifndef __ASM_GENERIC_IPCBUF_H
 #define __ASM_GENERIC_IPCBUF_H
 
+#include <linux/posix_types.h>
+
 /*
  * The generic ipc64_perm structure:
  * Note extra padding because this structure is passed back and forth
diff --git a/arch/s390/include/uapi/asm/ipcbuf.h b/arch/s390/include/uapi/asm/ipcbuf.h
index 37f293d..9f1185c 100644
--- a/arch/s390/include/uapi/asm/ipcbuf.h
+++ b/arch/s390/include/uapi/asm/ipcbuf.h
@@ -1,6 +1,8 @@
 #ifndef __S390_IPCBUF_H__
 #define __S390_IPCBUF_H__
 
+#include <linux/posix_types.h>
+
 /*
  * The user_ipc_perm structure for S/390 architecture.
  * Note extra padding because this structure is passed back and forth
diff --git a/arch/sparc/include/uapi/asm/ipcbuf.h b/arch/sparc/include/uapi/asm/ipcbuf.h
index 66013b4..b7b1bcb 100644
--- a/arch/sparc/include/uapi/asm/ipcbuf.h
+++ b/arch/sparc/include/uapi/asm/ipcbuf.h
@@ -1,6 +1,8 @@
 #ifndef __SPARC_IPCBUF_H
 #define __SPARC_IPCBUF_H
 
+#include <linux/posix_types.h>
+
 /*
  * The ipc64_perm structure for sparc/sparc64 architecture.
  * Note extra padding because this structure is passed back and forth
diff --git a/arch/xtensa/include/uapi/asm/ipcbuf.h b/arch/xtensa/include/uapi/asm/ipcbuf.h
index c33aa6a..7442e48 100644
--- a/arch/xtensa/include/uapi/asm/ipcbuf.h
+++ b/arch/xtensa/include/uapi/asm/ipcbuf.h
@@ -11,6 +11,8 @@
 #ifndef _XTENSA_IPCBUF_H
 #define _XTENSA_IPCBUF_H
 
+#include <linux/posix_types.h>
+
 /*
  * Pad space is left for:
  * - 32-bit mode_t and seq
-- 
ldv

^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH] uapi: fix another asm/shmbuf.h userspace compilation error
@ 2017-03-02  0:46 Dmitry V. Levin
  2017-03-02  0:46 ` Dmitry V. Levin
  2017-03-02 13:07 ` Arnd Bergmann
  0 siblings, 2 replies; 28+ messages in thread
From: Dmitry V. Levin @ 2017-03-02  0:46 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Haavard Skinnemoen, Hans-Christian Egtvedt, Tony Luck, Fenghua Yu,
	Ralf Baechle, David Howells, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, David S. Miller, Chris Zankel, Max Filippov,
	linux-arch, linux-alpha, linux-ia64

Replace size_t with __kernel_size_t to fix asm/shmbuf.h userspace
compilation errors like this:

/usr/include/asm-generic/shmbuf.h:28:2: error: unknown type name 'size_t'
  size_t   shm_segsz; /* size of segment (bytes) */

x32 is the only architecture where sizeof(size_t) is less than
sizeof(__kernel_size_t), but as the kernel treats shm_segsz field as
__kernel_size_t anyway, UAPI should follow.  Thanks to little-endiannes
of x32 and 64-bit alignment of the field following shm_segsz, this
change doesn't break ABI, and the difference doesn't manifest itself
easily.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 include/uapi/asm-generic/shmbuf.h      | 2 +-
 arch/alpha/include/uapi/asm/shmbuf.h   | 2 +-
 arch/avr32/include/uapi/asm/shmbuf.h   | 2 +-
 arch/frv/include/uapi/asm/shmbuf.h     | 2 +-
 arch/ia64/include/uapi/asm/shmbuf.h    | 2 +-
 arch/m32r/include/uapi/asm/shmbuf.h    | 2 +-
 arch/mips/include/uapi/asm/shmbuf.h    | 2 +-
 arch/mn10300/include/uapi/asm/shmbuf.h | 2 +-
 arch/powerpc/include/uapi/asm/shmbuf.h | 2 +-
 arch/s390/include/uapi/asm/shmbuf.h    | 2 +-
 arch/sparc/include/uapi/asm/shmbuf.h   | 2 +-
 arch/xtensa/include/uapi/asm/shmbuf.h  | 4 ++--
 12 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
index 2a6d508..0756934 100644
--- a/include/uapi/asm-generic/shmbuf.h
+++ b/include/uapi/asm-generic/shmbuf.h
@@ -25,7 +25,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 #if __BITS_PER_LONG != 64
 	unsigned long		__unused1;
diff --git a/arch/alpha/include/uapi/asm/shmbuf.h b/arch/alpha/include/uapi/asm/shmbuf.h
index 6156099..e32ed1f 100644
--- a/arch/alpha/include/uapi/asm/shmbuf.h
+++ b/arch/alpha/include/uapi/asm/shmbuf.h
@@ -14,7 +14,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	__kernel_time_t		shm_dtime;	/* last detach time */
 	__kernel_time_t		shm_ctime;	/* last change time */
diff --git a/arch/avr32/include/uapi/asm/shmbuf.h b/arch/avr32/include/uapi/asm/shmbuf.h
index c8e5234..2804f25 100644
--- a/arch/avr32/include/uapi/asm/shmbuf.h
+++ b/arch/avr32/include/uapi/asm/shmbuf.h
@@ -15,7 +15,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	unsigned long		__unused1;
 	__kernel_time_t		shm_dtime;	/* last detach time */
diff --git a/arch/frv/include/uapi/asm/shmbuf.h b/arch/frv/include/uapi/asm/shmbuf.h
index 943746c..2af199f 100644
--- a/arch/frv/include/uapi/asm/shmbuf.h
+++ b/arch/frv/include/uapi/asm/shmbuf.h
@@ -15,7 +15,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	unsigned long		__unused1;
 	__kernel_time_t		shm_dtime;	/* last detach time */
diff --git a/arch/ia64/include/uapi/asm/shmbuf.h b/arch/ia64/include/uapi/asm/shmbuf.h
index ca81d77e..8e35495 100644
--- a/arch/ia64/include/uapi/asm/shmbuf.h
+++ b/arch/ia64/include/uapi/asm/shmbuf.h
@@ -14,7 +14,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	__kernel_time_t		shm_dtime;	/* last detach time */
 	__kernel_time_t		shm_ctime;	/* last change time */
diff --git a/arch/m32r/include/uapi/asm/shmbuf.h b/arch/m32r/include/uapi/asm/shmbuf.h
index 714de6e..fa36b9e 100644
--- a/arch/m32r/include/uapi/asm/shmbuf.h
+++ b/arch/m32r/include/uapi/asm/shmbuf.h
@@ -15,7 +15,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	unsigned long		__unused1;
 	__kernel_time_t		shm_dtime;	/* last detach time */
diff --git a/arch/mips/include/uapi/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h
index f47d193..95c53ff 100644
--- a/arch/mips/include/uapi/asm/shmbuf.h
+++ b/arch/mips/include/uapi/asm/shmbuf.h
@@ -14,7 +14,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	__kernel_time_t		shm_dtime;	/* last detach time */
 	__kernel_time_t		shm_ctime;	/* last change time */
diff --git a/arch/mn10300/include/uapi/asm/shmbuf.h b/arch/mn10300/include/uapi/asm/shmbuf.h
index 71df684..e156878 100644
--- a/arch/mn10300/include/uapi/asm/shmbuf.h
+++ b/arch/mn10300/include/uapi/asm/shmbuf.h
@@ -15,7 +15,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	unsigned long		__unused1;
 	__kernel_time_t		shm_dtime;	/* last detach time */
diff --git a/arch/powerpc/include/uapi/asm/shmbuf.h b/arch/powerpc/include/uapi/asm/shmbuf.h
index 7937289..a2425e5 100644
--- a/arch/powerpc/include/uapi/asm/shmbuf.h
+++ b/arch/powerpc/include/uapi/asm/shmbuf.h
@@ -38,7 +38,7 @@ struct shmid64_ds {
 #ifndef __powerpc64__
 	unsigned long		__unused4;
 #endif
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_pid_t		shm_cpid;	/* pid of creator */
 	__kernel_pid_t		shm_lpid;	/* pid of last operator */
 	unsigned long		shm_nattch;	/* no. of current attaches */
diff --git a/arch/s390/include/uapi/asm/shmbuf.h b/arch/s390/include/uapi/asm/shmbuf.h
index 9ce1d9f..9ddf9e0 100644
--- a/arch/s390/include/uapi/asm/shmbuf.h
+++ b/arch/s390/include/uapi/asm/shmbuf.h
@@ -15,7 +15,7 @@
 
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 #ifndef __s390x__
 	unsigned long		__unused1;
diff --git a/arch/sparc/include/uapi/asm/shmbuf.h b/arch/sparc/include/uapi/asm/shmbuf.h
index f651952..ed72656 100644
--- a/arch/sparc/include/uapi/asm/shmbuf.h
+++ b/arch/sparc/include/uapi/asm/shmbuf.h
@@ -27,7 +27,7 @@ struct shmid64_ds {
 	__kernel_time_t		shm_dtime;	/* last detach time */
 	PADDING(__pad3)
 	__kernel_time_t		shm_ctime;	/* last change time */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_pid_t		shm_cpid;	/* pid of creator */
 	__kernel_pid_t		shm_lpid;	/* pid of last operator */
 	unsigned long		shm_nattch;	/* no. of current attaches */
diff --git a/arch/xtensa/include/uapi/asm/shmbuf.h b/arch/xtensa/include/uapi/asm/shmbuf.h
index ad90d05..8d9206e 100644
--- a/arch/xtensa/include/uapi/asm/shmbuf.h
+++ b/arch/xtensa/include/uapi/asm/shmbuf.h
@@ -24,7 +24,7 @@
 #if defined (__XTENSA_EL__)
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	unsigned long		__unused1;
 	__kernel_time_t		shm_dtime;	/* last detach time */
@@ -40,7 +40,7 @@ struct shmid64_ds {
 #elif defined (__XTENSA_EB__)
 struct shmid64_ds {
 	struct ipc64_perm	shm_perm;	/* operation perms */
-	size_t			shm_segsz;	/* size of segment (bytes) */
+	__kernel_size_t		shm_segsz;	/* size of segment (bytes) */
 	__kernel_time_t		shm_atime;	/* last attach time */
 	unsigned long		__unused1;
 	__kernel_time_t		shm_dtime;	/* last detach time */
-- 
ldv

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2021-12-27 10:53 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-26 18:29 [PATCH] uapi: fix asm/ipcbuf.h userspace compilation errors Dmitry V. Levin
2017-02-26 18:29 ` Dmitry V. Levin
2017-03-01 16:23 ` Arnd Bergmann
2017-03-02  0:22   ` [PATCH 1/3] uapi: fix asm/msgbuf.h " Dmitry V. Levin
2017-03-02  0:22     ` Dmitry V. Levin
2017-03-02  0:22   ` [PATCH 2/3] uapi: fix asm/sembuf.h " Dmitry V. Levin
2017-03-02  0:22     ` Dmitry V. Levin
2017-03-02  0:22   ` [PATCH 3/3] uapi: fix asm/shmbuf.h " Dmitry V. Levin
2017-03-02  0:22     ` Dmitry V. Levin
2017-03-02 13:14     ` Arnd Bergmann
2017-03-02 13:14       ` Arnd Bergmann
2021-12-27 10:53       ` [PATCH v2] " Dmitry V. Levin
  -- strict thread matches above, loose matches on Subject: below --
2017-03-02  0:46 [PATCH] uapi: fix another asm/shmbuf.h userspace compilation error Dmitry V. Levin
2017-03-02  0:46 ` Dmitry V. Levin
2017-03-02 13:07 ` Arnd Bergmann
2017-03-02 13:07   ` Arnd Bergmann
2017-03-26  3:27   ` [PATCH 0/5] uapi: fix userspace compilation of asm/ ipc headers Dmitry V. Levin
2017-03-26  3:30     ` [PATCH 1/5] uapi: fix asm/ipcbuf.h userspace compilation errors Dmitry V. Levin
2017-03-26  3:30     ` [PATCH 2/5] uapi: fix asm/msgbuf.h " Dmitry V. Levin
2017-03-26  3:30       ` Dmitry V. Levin
2017-03-26  3:30     ` [PATCH 3/5] uapi: fix asm/sembuf.h " Dmitry V. Levin
2017-03-26  3:30       ` Dmitry V. Levin
2017-03-26  3:30     ` [PATCH 4/5] uapi: fix asm/shmbuf.h " Dmitry V. Levin
2017-03-26  3:30       ` Dmitry V. Levin
2017-03-26  3:30     ` [PATCH 5/5] uapi: fix another asm/shmbuf.h userspace compilation error Dmitry V. Levin
2017-03-26  3:30       ` Dmitry V. Levin
2017-08-04 15:22   ` [PATCH] " James Hogan
2017-08-04 15:22     ` James Hogan

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).