Skip to content

Commit 0fb9dc2

Browse files
masahir0ytorvalds
authored andcommitted
arch: sembuf.h: make uapi asm/sembuf.h self-contained
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]>
1 parent 9ef0e00 commit 0fb9dc2

File tree

8 files changed

+11
-1
lines changed

8 files changed

+11
-1
lines changed

arch/mips/include/uapi/asm/sembuf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _ASM_SEMBUF_H
33
#define _ASM_SEMBUF_H
44

5+
#include <asm/ipcbuf.h>
6+
57
/*
68
* The semid64_ds structure for the MIPS architecture.
79
* Note extra padding because this structure is passed back and forth

arch/parisc/include/uapi/asm/sembuf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define _PARISC_SEMBUF_H
44

55
#include <asm/bitsperlong.h>
6+
#include <asm/ipcbuf.h>
67

78
/*
89
* The semid64_ds structure for parisc architecture.

arch/powerpc/include/uapi/asm/sembuf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _ASM_POWERPC_SEMBUF_H
33
#define _ASM_POWERPC_SEMBUF_H
44

5+
#include <asm/ipcbuf.h>
6+
57
/*
68
* This program is free software; you can redistribute it and/or
79
* modify it under the terms of the GNU General Public License

arch/sparc/include/uapi/asm/sembuf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _SPARC_SEMBUF_H
33
#define _SPARC_SEMBUF_H
44

5+
#include <asm/ipcbuf.h>
6+
57
/*
68
* The semid64_ds structure for sparc architecture.
79
* Note extra padding because this structure is passed back and forth

arch/x86/include/uapi/asm/sembuf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _ASM_X86_SEMBUF_H
33
#define _ASM_X86_SEMBUF_H
44

5+
#include <asm/ipcbuf.h>
6+
57
/*
68
* The semid64_ds structure for x86 architecture.
79
* Note extra padding because this structure is passed back and forth

arch/xtensa/include/uapi/asm/sembuf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define _XTENSA_SEMBUF_H
2323

2424
#include <asm/byteorder.h>
25+
#include <asm/ipcbuf.h>
2526

2627
struct semid64_ds {
2728
struct ipc64_perm sem_perm; /* permissions .. see ipc.h */

include/uapi/asm-generic/sembuf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define __ASM_GENERIC_SEMBUF_H
44

55
#include <asm/bitsperlong.h>
6+
#include <asm/ipcbuf.h>
67

78
/*
89
* The semid64_ds structure for x86 architecture.

usr/include/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) -I$(objtree)/usr/include
1616
# Please consider to fix the header first.
1717
#
1818
# Sorted alphabetically.
19-
header-test- += asm/sembuf.h
2019
header-test- += asm/shmbuf.h
2120
header-test- += asm/signal.h
2221
header-test- += asm/ucontext.h

0 commit comments

Comments
 (0)