Skip to content

Commit

Permalink
arch: msgbuf.h: make uapi asm/msgbuf.h self-contained
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
masahir0y authored and torvalds committed Dec 5, 2019
1 parent 5b00967 commit 9ef0e00
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/mips/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef _ASM_MSGBUF_H
#define _ASM_MSGBUF_H

#include <asm/ipcbuf.h>

/*
* The msqid64_ds structure for the MIPS architecture.
Expand Down
1 change: 1 addition & 0 deletions arch/parisc/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define _PARISC_MSGBUF_H

#include <asm/bitsperlong.h>
#include <asm/ipcbuf.h>

/*
* The msqid64_ds structure for parisc architecture, copied from sparc.
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _ASM_POWERPC_MSGBUF_H
#define _ASM_POWERPC_MSGBUF_H

#include <asm/ipcbuf.h>

/*
* The msqid64_ds structure for the PowerPC architecture.
* Note extra padding because this structure is passed back and forth
Expand Down
2 changes: 2 additions & 0 deletions arch/sparc/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _SPARC_MSGBUF_H
#define _SPARC_MSGBUF_H

#include <asm/ipcbuf.h>

/*
* The msqid64_ds structure for sparc64 architecture.
* Note extra padding because this structure is passed back and forth
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#if !defined(__x86_64__) || !defined(__ILP32__)
#include <asm-generic/msgbuf.h>
#else

#include <asm/ipcbuf.h>

/*
* The msqid64_ds structure for x86 architecture with x32 ABI.
*
Expand Down
2 changes: 2 additions & 0 deletions arch/xtensa/include/uapi/asm/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#ifndef _XTENSA_MSGBUF_H
#define _XTENSA_MSGBUF_H

#include <asm/ipcbuf.h>

struct msqid64_ds {
struct ipc64_perm msg_perm;
#ifdef __XTENSA_EB__
Expand Down
2 changes: 2 additions & 0 deletions include/uapi/asm-generic/msgbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define __ASM_GENERIC_MSGBUF_H

#include <asm/bitsperlong.h>
#include <asm/ipcbuf.h>

/*
* generic msqid64_ds structure.
*
Expand Down
1 change: 0 additions & 1 deletion usr/include/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) -I$(objtree)/usr/include
# Please consider to fix the header first.
#
# Sorted alphabetically.
header-test- += asm/msgbuf.h
header-test- += asm/sembuf.h
header-test- += asm/shmbuf.h
header-test- += asm/signal.h
Expand Down

0 comments on commit 9ef0e00

Please sign in to comment.