Skip to content

Commit

Permalink
arch: sembuf.h: make uapi asm/sembuf.h self-contained
Browse files Browse the repository at this point in the history
Userspace cannot compile <asm/sembuf.h> due to some missing type
definitions.  For example, building it for x86 fails as follows:

    CC      usr/include/asm/sembuf.h.s
  In file included from <command-line>:32:0:
  usr/include/asm/sembuf.h:17:20: error: field `sem_perm' has incomplete type
    struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
                      ^~~~~~~~
  usr/include/asm/sembuf.h:24:2: error: unknown type name `__kernel_time_t'
    __kernel_time_t sem_otime; /* last semop time */
    ^~~~~~~~~~~~~~~
  usr/include/asm/sembuf.h:25:2: error: unknown type name `__kernel_ulong_t'
    __kernel_ulong_t __unused1;
    ^~~~~~~~~~~~~~~~
  usr/include/asm/sembuf.h:26:2: error: unknown type name `__kernel_time_t'
    __kernel_time_t sem_ctime; /* last change time */
    ^~~~~~~~~~~~~~~
  usr/include/asm/sembuf.h:27:2: error: unknown type name `__kernel_ulong_t'
    __kernel_ulong_t __unused2;
    ^~~~~~~~~~~~~~~~
  usr/include/asm/sembuf.h:29:2: error: unknown type name `__kernel_ulong_t'
    __kernel_ulong_t sem_nsems; /* no. of semaphores in array */
    ^~~~~~~~~~~~~~~~
  usr/include/asm/sembuf.h:30:2: error: unknown type name `__kernel_ulong_t'
    __kernel_ulong_t __unused3;
    ^~~~~~~~~~~~~~~~
  usr/include/asm/sembuf.h:31:2: error: unknown type name `__kernel_ulong_t'
    __kernel_ulong_t __unused4;
    ^~~~~~~~~~~~~~~~

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/[email protected]
Signed-off-by: Masahiro Yamada <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
masahir0y authored and torvalds committed Dec 5, 2019
1 parent 9ef0e00 commit 0fb9dc2
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arch/mips/include/uapi/asm/sembuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _ASM_SEMBUF_H
#define _ASM_SEMBUF_H

#include <asm/ipcbuf.h>

/*
* The semid64_ds structure for the MIPS architecture.
* Note extra padding because this structure is passed back and forth
Expand Down
1 change: 1 addition & 0 deletions arch/parisc/include/uapi/asm/sembuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define _PARISC_SEMBUF_H

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

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

#include <asm/ipcbuf.h>

/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand Down
2 changes: 2 additions & 0 deletions arch/sparc/include/uapi/asm/sembuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#ifndef _SPARC_SEMBUF_H
#define _SPARC_SEMBUF_H

#include <asm/ipcbuf.h>

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

#include <asm/ipcbuf.h>

/*
* The semid64_ds structure for x86 architecture.
* Note extra padding because this structure is passed back and forth
Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/include/uapi/asm/sembuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define _XTENSA_SEMBUF_H

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

struct semid64_ds {
struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
Expand Down
1 change: 1 addition & 0 deletions include/uapi/asm-generic/sembuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define __ASM_GENERIC_SEMBUF_H

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

/*
* The semid64_ds structure for x86 architecture.
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/sembuf.h
header-test- += asm/shmbuf.h
header-test- += asm/signal.h
header-test- += asm/ucontext.h
Expand Down

0 comments on commit 0fb9dc2

Please sign in to comment.