Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch: msgbuf.h: make uapi asm/msgbuf.h self-contained

Userspace cannot compile <asm/msgbuf.h> due to some missing type
definitions. For example, building it for x86 fails as follows:

CC usr/include/asm/msgbuf.h.s
In file included from usr/include/asm/msgbuf.h:6:0,
from <command-line>:32:
usr/include/asm-generic/msgbuf.h:25:20: error: field `msg_perm' has incomplete type
struct ipc64_perm msg_perm;
^~~~~~~~
usr/include/asm-generic/msgbuf.h:27:2: error: unknown type name `__kernel_time_t'
__kernel_time_t msg_stime; /* last msgsnd time */
^~~~~~~~~~~~~~~
usr/include/asm-generic/msgbuf.h:28:2: error: unknown type name `__kernel_time_t'
__kernel_time_t msg_rtime; /* last msgrcv time */
^~~~~~~~~~~~~~~
usr/include/asm-generic/msgbuf.h:29:2: error: unknown type name `__kernel_time_t'
__kernel_time_t msg_ctime; /* last change time */
^~~~~~~~~~~~~~~
usr/include/asm-generic/msgbuf.h:41:2: error: unknown type name `__kernel_pid_t'
__kernel_pid_t msg_lspid; /* pid of last msgsnd */
^~~~~~~~~~~~~~
usr/include/asm-generic/msgbuf.h:42:2: error: unknown type name `__kernel_pid_t'
__kernel_pid_t msg_lrpid; /* last receive pid */
^~~~~~~~~~~~~~

It is just a matter of missing include directive.

Include <asm/ipcbuf.h> to make it self-contained, and add it to
the compile-test coverage.

Link: http://lkml.kernel.org/r/20191030063855.9989-2-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Masahiro Yamada and committed by
Linus Torvalds
9ef0e004 5b009673

+13 -1
+1
arch/mips/include/uapi/asm/msgbuf.h
··· 2 2 #ifndef _ASM_MSGBUF_H 3 3 #define _ASM_MSGBUF_H 4 4 5 + #include <asm/ipcbuf.h> 5 6 6 7 /* 7 8 * The msqid64_ds structure for the MIPS architecture.
+1
arch/parisc/include/uapi/asm/msgbuf.h
··· 3 3 #define _PARISC_MSGBUF_H 4 4 5 5 #include <asm/bitsperlong.h> 6 + #include <asm/ipcbuf.h> 6 7 7 8 /* 8 9 * The msqid64_ds structure for parisc architecture, copied from sparc.
+2
arch/powerpc/include/uapi/asm/msgbuf.h
··· 2 2 #ifndef _ASM_POWERPC_MSGBUF_H 3 3 #define _ASM_POWERPC_MSGBUF_H 4 4 5 + #include <asm/ipcbuf.h> 6 + 5 7 /* 6 8 * The msqid64_ds structure for the PowerPC architecture. 7 9 * Note extra padding because this structure is passed back and forth
+2
arch/sparc/include/uapi/asm/msgbuf.h
··· 2 2 #ifndef _SPARC_MSGBUF_H 3 3 #define _SPARC_MSGBUF_H 4 4 5 + #include <asm/ipcbuf.h> 6 + 5 7 /* 6 8 * The msqid64_ds structure for sparc64 architecture. 7 9 * Note extra padding because this structure is passed back and forth
+3
arch/x86/include/uapi/asm/msgbuf.h
··· 5 5 #if !defined(__x86_64__) || !defined(__ILP32__) 6 6 #include <asm-generic/msgbuf.h> 7 7 #else 8 + 9 + #include <asm/ipcbuf.h> 10 + 8 11 /* 9 12 * The msqid64_ds structure for x86 architecture with x32 ABI. 10 13 *
+2
arch/xtensa/include/uapi/asm/msgbuf.h
··· 17 17 #ifndef _XTENSA_MSGBUF_H 18 18 #define _XTENSA_MSGBUF_H 19 19 20 + #include <asm/ipcbuf.h> 21 + 20 22 struct msqid64_ds { 21 23 struct ipc64_perm msg_perm; 22 24 #ifdef __XTENSA_EB__
+2
include/uapi/asm-generic/msgbuf.h
··· 3 3 #define __ASM_GENERIC_MSGBUF_H 4 4 5 5 #include <asm/bitsperlong.h> 6 + #include <asm/ipcbuf.h> 7 + 6 8 /* 7 9 * generic msqid64_ds structure. 8 10 *
-1
usr/include/Makefile
··· 16 16 # Please consider to fix the header first. 17 17 # 18 18 # Sorted alphabetically. 19 - header-test- += asm/msgbuf.h 20 19 header-test- += asm/sembuf.h 21 20 header-test- += asm/shmbuf.h 22 21 header-test- += asm/signal.h