* [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
@ 2016-08-22 18:32 ` Mikko Rapeli
2016-08-24 15:36 ` Arnd Bergmann
2016-08-22 18:32 ` [PATCH v05 15/72] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
` (6 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compilation error:
error: unknown type name ‘__kernel_key_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/ipcbuf.h | 2 ++
1 file changed, 2 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
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 15/72] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
2016-08-22 18:32 ` [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 16/72] include/uapi/asm-generic/shmbuf.h: include fixes Mikko Rapeli
` (5 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compilation errors like:
error: field ‘msg_perm’ has incomplete type
struct ipc64_perm msg_perm
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/msgbuf.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
index f55ecc4..f5fbd8e 100644
--- a/include/uapi/asm-generic/msgbuf.h
+++ b/include/uapi/asm-generic/msgbuf.h
@@ -2,6 +2,8 @@
#define __ASM_GENERIC_MSGBUF_H
#include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+
/*
* generic msqid64_ds structure.
*
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 15/72] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h
2016-08-22 18:32 ` [PATCH v05 15/72] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
0 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compilation errors like:
error: field ‘msg_perm’ has incomplete type
struct ipc64_perm msg_perm
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/msgbuf.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
index f55ecc4..f5fbd8e 100644
--- a/include/uapi/asm-generic/msgbuf.h
+++ b/include/uapi/asm-generic/msgbuf.h
@@ -2,6 +2,8 @@
#define __ASM_GENERIC_MSGBUF_H
#include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+
/*
* generic msqid64_ds structure.
*
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 16/72] include/uapi/asm-generic/shmbuf.h: include fixes
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
2016-08-22 18:32 ` [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 15/72] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 17/72] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli
` (4 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Include linux/types.h and asm/msgbuf.h and use __kernel_size_t instead
of size_t.
Fixes userspace compilation errors like:
error: field ‘shm_perm’ has incomplete type
struct ipc64_perm shm_perm; /* operation perms */
error: unknown type name ‘size_t’
error: unknown type name ‘__kernel_time_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/shmbuf.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
index 7e9fb2f..ae867ad 100644
--- a/include/uapi/asm-generic/shmbuf.h
+++ b/include/uapi/asm-generic/shmbuf.h
@@ -1,7 +1,9 @@
#ifndef __ASM_GENERIC_SHMBUF_H
#define __ASM_GENERIC_SHMBUF_H
+#include <linux/types.h>
#include <asm/bitsperlong.h>
+#include <asm/msgbuf.h>
/*
* The shmid64_ds structure for x86 architecture.
@@ -24,7 +26,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;
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 17/72] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
` (2 preceding siblings ...)
2016-08-22 18:32 ` [PATCH v05 16/72] include/uapi/asm-generic/shmbuf.h: include fixes Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
` (3 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compilation errors like:
error: field ‘msg_perm’ has incomplete type
struct ipc64_perm msg_perm;
error: unknown type name ‘__kernel_ulong_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/sembuf.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/asm-generic/sembuf.h b/include/uapi/asm-generic/sembuf.h
index 4cb2c13..17d523f 100644
--- a/include/uapi/asm-generic/sembuf.h
+++ b/include/uapi/asm-generic/sembuf.h
@@ -2,6 +2,8 @@
#define __ASM_GENERIC_SEMBUF_H
#include <asm/bitsperlong.h>
+#include <asm/posix_types.h>
+#include <asm/ipcbuf.h>
/*
* The semid64_ds structure for x86 architecture.
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
` (3 preceding siblings ...)
2016-08-22 18:32 ` [PATCH v05 17/72] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 35/72] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
` (2 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compiler error:
error: unknown type name ‘size_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/signal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 3094618..6bbcdfa 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -113,7 +113,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;
#endif /* __ASSEMBLY__ */
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t
2016-08-22 18:32 ` [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
0 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compiler error:
error: unknown type name ‘size_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/signal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 3094618..6bbcdfa 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -113,7 +113,7 @@ struct sigaction {
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
- size_t ss_size;
+ __kernel_size_t ss_size;
} stack_t;
#endif /* __ASSEMBLY__ */
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 35/72] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
` (4 preceding siblings ...)
2016-08-22 18:32 ` [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 71/72] uapi term*.h: glibc termios.h " Mikko Rapeli
7 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compiler errors:
error: unknown type name ‘stack_t’
error: field ‘uc_mcontext’ has incomplete type
struct sigcontext uc_mcontext;
error: unknown type name ‘sigset_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/ucontext.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/uapi/asm-generic/ucontext.h b/include/uapi/asm-generic/ucontext.h
index ad77343..4481528 100644
--- a/include/uapi/asm-generic/ucontext.h
+++ b/include/uapi/asm-generic/ucontext.h
@@ -1,6 +1,9 @@
#ifndef __ASM_GENERIC_UCONTEXT_H
#define __ASM_GENERIC_UCONTEXT_H
+#include <asm/signal.h>
+#include <asm/sigcontext.h>
+
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 35/72] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h
2016-08-22 18:32 ` [PATCH v05 35/72] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
0 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
To: linux-kernel; +Cc: Mikko Rapeli, Arnd Bergmann, linux-arch
Fixes userspace compiler errors:
error: unknown type name ‘stack_t’
error: field ‘uc_mcontext’ has incomplete type
struct sigcontext uc_mcontext;
error: unknown type name ‘sigset_t’
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/ucontext.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/uapi/asm-generic/ucontext.h b/include/uapi/asm-generic/ucontext.h
index ad77343..4481528 100644
--- a/include/uapi/asm-generic/ucontext.h
+++ b/include/uapi/asm-generic/ucontext.h
@@ -1,6 +1,9 @@
#ifndef __ASM_GENERIC_UCONTEXT_H
#define __ASM_GENERIC_UCONTEXT_H
+#include <asm/signal.h>
+#include <asm/sigcontext.h>
+
struct ucontext {
unsigned long uc_flags;
struct ucontext *uc_link;
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
` (5 preceding siblings ...)
2016-08-22 18:32 ` [PATCH v05 35/72] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
2016-08-22 18:33 ` Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 71/72] uapi term*.h: glibc termios.h " Mikko Rapeli
7 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
To: linux-kernel
Cc: Mikko Rapeli, Arnd Bergmann, Jeff Layton, J. Bruce Fields,
David S. Miller, Nicolas Dichtel, linux-arch, linux-fsdevel
Fixes these userspace compile warnings and error when glibc fcntl.h is
included before linux/fcntl.h:
asm-generic/fcntl.h:18:0: warning: "O_ACCMODE" redefined
asm-generic/fcntl.h:19:0: warning: "O_RDONLY" redefined
asm-generic/fcntl.h:20:0: warning: "O_WRONLY" redefined
asm-generic/fcntl.h:21:0: warning: "O_RDWR" redefined
asm-generic/fcntl.h:195:8: error: redefinition of ‘struct flock’
linux/fcntl.h:16:0: warning: "F_DUPFD_CLOEXEC" redefined
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/fcntl.h | 6 ++++++
include/uapi/linux/fcntl.h | 3 +++
include/uapi/linux/libc-compat.h | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+)
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
index e063eff..3b429ce 100644
--- a/include/uapi/asm-generic/fcntl.h
+++ b/include/uapi/asm-generic/fcntl.h
@@ -1,6 +1,7 @@
#ifndef _ASM_GENERIC_FCNTL_H
#define _ASM_GENERIC_FCNTL_H
+#include <linux/libc-compat.h>
#include <linux/types.h>
/*
@@ -15,10 +16,13 @@
* When introducing new O_* bits, please check its uniqueness in fcntl_init().
*/
+#if __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR
#define O_ACCMODE 00000003
#define O_RDONLY 00000000
#define O_WRONLY 00000001
#define O_RDWR 00000002
+#endif /* __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR */
+
#ifndef O_CREAT
#define O_CREAT 00000100 /* not fcntl */
#endif
@@ -192,6 +196,7 @@ struct f_owner_ex {
#define __ARCH_FLOCK_PAD
#endif
+#if __UAPI_DEF_FLOCK
struct flock {
short l_type;
short l_whence;
@@ -200,6 +205,7 @@ struct flock {
__kernel_pid_t l_pid;
__ARCH_FLOCK_PAD
};
+#endif /* __UAPI_DEF_FLOCK */
#endif
#ifndef HAVE_ARCH_STRUCT_FLOCK64
diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
index beed138..279bcfb 100644
--- a/include/uapi/linux/fcntl.h
+++ b/include/uapi/linux/fcntl.h
@@ -1,6 +1,7 @@
#ifndef _UAPI_LINUX_FCNTL_H
#define _UAPI_LINUX_FCNTL_H
+#include <linux/libc-compat.h>
#include <asm/fcntl.h>
#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
@@ -13,7 +14,9 @@
#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
/* Create a file descriptor with FD_CLOEXEC set. */
+#if __UAPI_DEF_F_DUPFD_CLOEXEC
#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
+#endif /* __UAPI_DEF_F_DUPFD_CLOEXEC */
/*
* Request nofications on a directory.
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 44b8a6b..40190a4 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -51,6 +51,21 @@
/* We have included glibc headers... */
#if defined(__GLIBC__)
+/* Coordinate with glibc fcntl.h header. */
+#if defined(_FCNTL_H)
+
+#define __UAPI_DEF_FLOCK 0
+#define __UAPI_DEF_F_DUPFD_CLOEXEC 0
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 0
+
+#else /* defined(_FCNTL_H) */
+
+#define __UAPI_DEF_FLOCK 1
+#define __UAPI_DEF_F_DUPFD_CLOEXEC 1
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 1
+
+#endif /* defined(_FCNTL_H) */
+
/* Coordinate with glibc net/if.h header. */
#if defined(_NET_IF_H) && defined(__USE_MISC)
@@ -170,6 +185,11 @@
* that we need. */
#else /* !defined(__GLIBC__) */
+/* Definitions for asm-generic/fcntl.h */
+#define __UAPI_DEF_FLOCK 1
+#define __UAPI_DEF_F_DUPFD_CLOEXEC 1
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 1
+
/* Definitions for if.h */
#define __UAPI_DEF_IF_IFCONF 1
#define __UAPI_DEF_IF_IFMAP 1
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes
2016-08-22 18:33 ` [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
0 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
To: linux-kernel
Cc: Mikko Rapeli, Arnd Bergmann, Jeff Layton, J. Bruce Fields,
David S. Miller, Nicolas Dichtel, linux-arch, linux-fsdevel
Fixes these userspace compile warnings and error when glibc fcntl.h is
included before linux/fcntl.h:
asm-generic/fcntl.h:18:0: warning: "O_ACCMODE" redefined
asm-generic/fcntl.h:19:0: warning: "O_RDONLY" redefined
asm-generic/fcntl.h:20:0: warning: "O_WRONLY" redefined
asm-generic/fcntl.h:21:0: warning: "O_RDWR" redefined
asm-generic/fcntl.h:195:8: error: redefinition of ‘struct flock’
linux/fcntl.h:16:0: warning: "F_DUPFD_CLOEXEC" redefined
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/fcntl.h | 6 ++++++
include/uapi/linux/fcntl.h | 3 +++
include/uapi/linux/libc-compat.h | 20 ++++++++++++++++++++
3 files changed, 29 insertions(+)
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
index e063eff..3b429ce 100644
--- a/include/uapi/asm-generic/fcntl.h
+++ b/include/uapi/asm-generic/fcntl.h
@@ -1,6 +1,7 @@
#ifndef _ASM_GENERIC_FCNTL_H
#define _ASM_GENERIC_FCNTL_H
+#include <linux/libc-compat.h>
#include <linux/types.h>
/*
@@ -15,10 +16,13 @@
* When introducing new O_* bits, please check its uniqueness in fcntl_init().
*/
+#if __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR
#define O_ACCMODE 00000003
#define O_RDONLY 00000000
#define O_WRONLY 00000001
#define O_RDWR 00000002
+#endif /* __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR */
+
#ifndef O_CREAT
#define O_CREAT 00000100 /* not fcntl */
#endif
@@ -192,6 +196,7 @@ struct f_owner_ex {
#define __ARCH_FLOCK_PAD
#endif
+#if __UAPI_DEF_FLOCK
struct flock {
short l_type;
short l_whence;
@@ -200,6 +205,7 @@ struct flock {
__kernel_pid_t l_pid;
__ARCH_FLOCK_PAD
};
+#endif /* __UAPI_DEF_FLOCK */
#endif
#ifndef HAVE_ARCH_STRUCT_FLOCK64
diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
index beed138..279bcfb 100644
--- a/include/uapi/linux/fcntl.h
+++ b/include/uapi/linux/fcntl.h
@@ -1,6 +1,7 @@
#ifndef _UAPI_LINUX_FCNTL_H
#define _UAPI_LINUX_FCNTL_H
+#include <linux/libc-compat.h>
#include <asm/fcntl.h>
#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
@@ -13,7 +14,9 @@
#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
/* Create a file descriptor with FD_CLOEXEC set. */
+#if __UAPI_DEF_F_DUPFD_CLOEXEC
#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
+#endif /* __UAPI_DEF_F_DUPFD_CLOEXEC */
/*
* Request nofications on a directory.
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 44b8a6b..40190a4 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -51,6 +51,21 @@
/* We have included glibc headers... */
#if defined(__GLIBC__)
+/* Coordinate with glibc fcntl.h header. */
+#if defined(_FCNTL_H)
+
+#define __UAPI_DEF_FLOCK 0
+#define __UAPI_DEF_F_DUPFD_CLOEXEC 0
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 0
+
+#else /* defined(_FCNTL_H) */
+
+#define __UAPI_DEF_FLOCK 1
+#define __UAPI_DEF_F_DUPFD_CLOEXEC 1
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 1
+
+#endif /* defined(_FCNTL_H) */
+
/* Coordinate with glibc net/if.h header. */
#if defined(_NET_IF_H) && defined(__USE_MISC)
@@ -170,6 +185,11 @@
* that we need. */
#else /* !defined(__GLIBC__) */
+/* Definitions for asm-generic/fcntl.h */
+#define __UAPI_DEF_FLOCK 1
+#define __UAPI_DEF_F_DUPFD_CLOEXEC 1
+#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 1
+
/* Definitions for if.h */
#define __UAPI_DEF_IF_IFCONF 1
#define __UAPI_DEF_IF_IFMAP 1
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 71/72] uapi term*.h: glibc termios.h header file compatibility fixes
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
` (6 preceding siblings ...)
2016-08-22 18:33 ` [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
2016-08-22 18:33 ` Mikko Rapeli
7 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
To: linux-kernel
Cc: Mikko Rapeli, Arnd Bergmann, David S. Miller, Nicolas Dichtel,
linux-arch
Fixes these userspace compile errors and warnings when glibc termios.h
is included before linux/termios.h:
asm-generic/termbits.h:11:8: error: redefinition of ‘struct termios’
asm-generic/termios.h:14:8: error: redefinition of ‘struct winsize’
asm-generic/termios.h:22:8: error: redefinition of ‘struct termio’
Not fixing multiple NCSS definitions since I don't know which one would be
correct so this warning remains:
asm-generic/termbits.h:10:0: warning: "NCCS" redefined
#define NCCS 19
^
bits/termios.h:27:0: note: this is the location of the previous definition
#define NCCS 32
^
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/termbits.h | 3 +++
include/uapi/asm-generic/termios.h | 5 +++++
include/uapi/linux/libc-compat.h | 28 ++++++++++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/include/uapi/asm-generic/termbits.h b/include/uapi/asm-generic/termbits.h
index 232b478..314bfef 100644
--- a/include/uapi/asm-generic/termbits.h
+++ b/include/uapi/asm-generic/termbits.h
@@ -1,6 +1,7 @@
#ifndef __ASM_GENERIC_TERMBITS_H
#define __ASM_GENERIC_TERMBITS_H
+#include <linux/libc-compat.h>
#include <linux/posix_types.h>
typedef unsigned char cc_t;
@@ -8,6 +9,7 @@ typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
#define NCCS 19
+#if __UAPI_DEF_TERMIOS
struct termios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
@@ -16,6 +18,7 @@ struct termios {
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS]; /* control characters */
};
+#endif /* __UAPI_DEF_TERMIOS */
struct termios2 {
tcflag_t c_iflag; /* input mode flags */
diff --git a/include/uapi/asm-generic/termios.h b/include/uapi/asm-generic/termios.h
index 0881760..3428999 100644
--- a/include/uapi/asm-generic/termios.h
+++ b/include/uapi/asm-generic/termios.h
@@ -8,17 +8,21 @@
* New architectures should not provide their own version.
*/
+#include <linux/libc-compat.h>
#include <asm/termbits.h>
#include <asm/ioctls.h>
+#if __UAPI_DEF_WINSIZE
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
+#endif /* __UAPI_DEF_WINSIZE */
#define NCC 8
+#if __UAPI_DEF_TERMIO
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
@@ -27,6 +31,7 @@ struct termio {
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
+#endif /* __UAPI_DEF_TERMIO */
/* modem lines */
#define TIOCM_LE 0x001
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index cb25f16..07a3462 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -230,6 +230,13 @@
#endif /* defined(_NETROSE_ROSE_H) */
+/* Coordinate with glibc pty.h */
+#if defined(_PTY_H)
+#define __UAPI_DEF_TERMIOS 0
+#else /* defined(_PTY_H) */
+#define __UAPI_DEF_TERMIOS 1
+#endif /* defined(_PTY_H) */
+
/* Coordinate with glibc time.h */
#if defined(_TIME_H)
#define __UAPI_DEF_TIMESPEC 0
@@ -245,6 +252,15 @@
#endif /* defined(_TIME_H) */
+/* Definitions for sys/ioctl.h */
+#if defined(_SYS_IOCTL_H)
+#define __UAPI_DEF_TERMIO 0
+#define __UAPI_DEF_WINSIZE 0
+#else /* defined(_SYS_IOCTL_H) */
+#define __UAPI_DEF_TERMIO 1
+#define __UAPI_DEF_WINSIZE 1
+#endif /* defined(_SYS_IOCTL_H) */
+
/* Definitions for sys/uio.h */
#if defined(_SYS_UIO_H)
#define __UAPI_DEF_IOVEC 0
@@ -265,6 +281,13 @@
#endif /* defined(_SYS_TIME_H) */
+/* Coordinate with glibc termios.h */
+#if defined(_TERMIOS_H)
+#define __UAPI_DEF_TERMIOS 0
+#else /* defined(_TERMIOS_H) */
+#define __UAPI_DEF_TERMIOS 1
+#endif /* defined(_TERMIOS_H) */
+
/* Definitions for xattr.h */
#if defined(_SYS_XATTR_H)
#define __UAPI_DEF_XATTR 0
@@ -282,6 +305,11 @@
#define __UAPI_DEF_F_DUPFD_CLOEXEC 1
#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 1
+/* Definitions for asm-generic/termbits.h and asm-generic/termios.h */
+#define __UAPI_DEF_TERMIO 1
+#define __UAPI_DEF_TERMIOS 1
+#define __UAPI_DEF_WINSIZE 1
+
/* Definitions for ax25.h */
#define __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD 1
#define __UAPI_DEF_SIOCAX25GETINFO 1
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v05 71/72] uapi term*.h: glibc termios.h header file compatibility fixes
2016-08-22 18:33 ` [PATCH v05 71/72] uapi term*.h: glibc termios.h " Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
0 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
To: linux-kernel
Cc: Mikko Rapeli, Arnd Bergmann, David S. Miller, Nicolas Dichtel,
linux-arch
Fixes these userspace compile errors and warnings when glibc termios.h
is included before linux/termios.h:
asm-generic/termbits.h:11:8: error: redefinition of ‘struct termios’
asm-generic/termios.h:14:8: error: redefinition of ‘struct winsize’
asm-generic/termios.h:22:8: error: redefinition of ‘struct termio’
Not fixing multiple NCSS definitions since I don't know which one would be
correct so this warning remains:
asm-generic/termbits.h:10:0: warning: "NCCS" redefined
#define NCCS 19
^
bits/termios.h:27:0: note: this is the location of the previous definition
#define NCCS 32
^
Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/asm-generic/termbits.h | 3 +++
include/uapi/asm-generic/termios.h | 5 +++++
include/uapi/linux/libc-compat.h | 28 ++++++++++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/include/uapi/asm-generic/termbits.h b/include/uapi/asm-generic/termbits.h
index 232b478..314bfef 100644
--- a/include/uapi/asm-generic/termbits.h
+++ b/include/uapi/asm-generic/termbits.h
@@ -1,6 +1,7 @@
#ifndef __ASM_GENERIC_TERMBITS_H
#define __ASM_GENERIC_TERMBITS_H
+#include <linux/libc-compat.h>
#include <linux/posix_types.h>
typedef unsigned char cc_t;
@@ -8,6 +9,7 @@ typedef unsigned int speed_t;
typedef unsigned int tcflag_t;
#define NCCS 19
+#if __UAPI_DEF_TERMIOS
struct termios {
tcflag_t c_iflag; /* input mode flags */
tcflag_t c_oflag; /* output mode flags */
@@ -16,6 +18,7 @@ struct termios {
cc_t c_line; /* line discipline */
cc_t c_cc[NCCS]; /* control characters */
};
+#endif /* __UAPI_DEF_TERMIOS */
struct termios2 {
tcflag_t c_iflag; /* input mode flags */
diff --git a/include/uapi/asm-generic/termios.h b/include/uapi/asm-generic/termios.h
index 0881760..3428999 100644
--- a/include/uapi/asm-generic/termios.h
+++ b/include/uapi/asm-generic/termios.h
@@ -8,17 +8,21 @@
* New architectures should not provide their own version.
*/
+#include <linux/libc-compat.h>
#include <asm/termbits.h>
#include <asm/ioctls.h>
+#if __UAPI_DEF_WINSIZE
struct winsize {
unsigned short ws_row;
unsigned short ws_col;
unsigned short ws_xpixel;
unsigned short ws_ypixel;
};
+#endif /* __UAPI_DEF_WINSIZE */
#define NCC 8
+#if __UAPI_DEF_TERMIO
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
@@ -27,6 +31,7 @@ struct termio {
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
+#endif /* __UAPI_DEF_TERMIO */
/* modem lines */
#define TIOCM_LE 0x001
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index cb25f16..07a3462 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -230,6 +230,13 @@
#endif /* defined(_NETROSE_ROSE_H) */
+/* Coordinate with glibc pty.h */
+#if defined(_PTY_H)
+#define __UAPI_DEF_TERMIOS 0
+#else /* defined(_PTY_H) */
+#define __UAPI_DEF_TERMIOS 1
+#endif /* defined(_PTY_H) */
+
/* Coordinate with glibc time.h */
#if defined(_TIME_H)
#define __UAPI_DEF_TIMESPEC 0
@@ -245,6 +252,15 @@
#endif /* defined(_TIME_H) */
+/* Definitions for sys/ioctl.h */
+#if defined(_SYS_IOCTL_H)
+#define __UAPI_DEF_TERMIO 0
+#define __UAPI_DEF_WINSIZE 0
+#else /* defined(_SYS_IOCTL_H) */
+#define __UAPI_DEF_TERMIO 1
+#define __UAPI_DEF_WINSIZE 1
+#endif /* defined(_SYS_IOCTL_H) */
+
/* Definitions for sys/uio.h */
#if defined(_SYS_UIO_H)
#define __UAPI_DEF_IOVEC 0
@@ -265,6 +281,13 @@
#endif /* defined(_SYS_TIME_H) */
+/* Coordinate with glibc termios.h */
+#if defined(_TERMIOS_H)
+#define __UAPI_DEF_TERMIOS 0
+#else /* defined(_TERMIOS_H) */
+#define __UAPI_DEF_TERMIOS 1
+#endif /* defined(_TERMIOS_H) */
+
/* Definitions for xattr.h */
#if defined(_SYS_XATTR_H)
#define __UAPI_DEF_XATTR 0
@@ -282,6 +305,11 @@
#define __UAPI_DEF_F_DUPFD_CLOEXEC 1
#define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR 1
+/* Definitions for asm-generic/termbits.h and asm-generic/termios.h */
+#define __UAPI_DEF_TERMIO 1
+#define __UAPI_DEF_TERMIOS 1
+#define __UAPI_DEF_WINSIZE 1
+
/* Definitions for ax25.h */
#define __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD 1
#define __UAPI_DEF_SIOCAX25GETINFO 1
--
2.8.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h
2016-08-22 18:32 ` [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
@ 2016-08-24 15:36 ` Arnd Bergmann
2016-11-15 19:31 ` Mikko Rapeli
0 siblings, 1 reply; 16+ messages in thread
From: Arnd Bergmann @ 2016-08-24 15:36 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: linux-kernel, linux-arch
On Monday, August 22, 2016 8:32:31 PM CEST Mikko Rapeli wrote:
> Fixes userspace compilation error:
>
> error: unknown type name ‘__kernel_key_t’
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
>
Looks good. I was on Cc for patches 14, 15, 16, 17, 18, 35,
65 and 71. They all seem reasonable to me, the only change
I would do is to remove "include/uapi/" from the subject,
and instead write it as
"asm-generic/ipcbuf.h: include linux/posix_types.h"
With that changed, please add
Acked-by: Arnd Bergmann <arnd@arndb.de>
if you want to keep the entire series together, or resend
those patches as a new series to me if you would like me to
apply them to the asm-generic git tree instead.
Arnd
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h
2016-08-24 15:36 ` Arnd Bergmann
@ 2016-11-15 19:31 ` Mikko Rapeli
2016-11-15 19:31 ` Mikko Rapeli
0 siblings, 1 reply; 16+ messages in thread
From: Mikko Rapeli @ 2016-11-15 19:31 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-kernel, linux-arch
On Wed, Aug 24, 2016 at 05:36:22PM +0200, Arnd Bergmann wrote:
> On Monday, August 22, 2016 8:32:31 PM CEST Mikko Rapeli wrote:
> > Fixes userspace compilation error:
> >
> > error: unknown type name ‘__kernel_key_t’
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> >
>
> Looks good. I was on Cc for patches 14, 15, 16, 17, 18, 35,
> 65 and 71. They all seem reasonable to me, the only change
> I would do is to remove "include/uapi/" from the subject,
> and instead write it as
>
> "asm-generic/ipcbuf.h: include linux/posix_types.h"
>
> With that changed, please add
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Thanks, done.
> if you want to keep the entire series together, or resend
> those patches as a new series to me if you would like me to
> apply them to the asm-generic git tree instead.
I will send a new series after fixing all other review findings and testing
the changes again.
-Mikko
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h
2016-11-15 19:31 ` Mikko Rapeli
@ 2016-11-15 19:31 ` Mikko Rapeli
0 siblings, 0 replies; 16+ messages in thread
From: Mikko Rapeli @ 2016-11-15 19:31 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-kernel, linux-arch
On Wed, Aug 24, 2016 at 05:36:22PM +0200, Arnd Bergmann wrote:
> On Monday, August 22, 2016 8:32:31 PM CEST Mikko Rapeli wrote:
> > Fixes userspace compilation error:
> >
> > error: unknown type name ‘__kernel_key_t’
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> >
>
> Looks good. I was on Cc for patches 14, 15, 16, 17, 18, 35,
> 65 and 71. They all seem reasonable to me, the only change
> I would do is to remove "include/uapi/" from the subject,
> and instead write it as
>
> "asm-generic/ipcbuf.h: include linux/posix_types.h"
>
> With that changed, please add
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Thanks, done.
> if you want to keep the entire series together, or resend
> those patches as a new series to me if you would like me to
> apply them to the asm-generic git tree instead.
I will send a new series after fixing all other review findings and testing
the changes again.
-Mikko
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-11-15 19:31 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
2016-08-22 18:32 ` [PATCH v05 14/72] include/uapi/asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
2016-08-24 15:36 ` Arnd Bergmann
2016-11-15 19:31 ` Mikko Rapeli
2016-11-15 19:31 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 15/72] include/uapi/asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 16/72] include/uapi/asm-generic/shmbuf.h: include fixes Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 17/72] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:32 ` [PATCH v05 35/72] include/uapi/asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
2016-08-22 18:32 ` Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes Mikko Rapeli
2016-08-22 18:33 ` Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 71/72] uapi term*.h: glibc termios.h " Mikko Rapeli
2016-08-22 18:33 ` Mikko Rapeli
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).