lapi: Add posix_types.h
RFC PATCH 1/1 lapi: Add posix_types.h
To fix undefined __kernel_ulong_t, which was defined in v3.4-rc1 in afead38d011a ("posix_types: Introduce __kernel_[u]long_t").
This fixed build error:
In file included from /usr/src/ltp/include/lapi/msgbuf.h:13,
from /usr/src/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c:9:/usr/src/ltp/include/lapi/ipcbuf.h: At top level:/usr/src/ltp/include/lapi/ipcbuf.h:187: error: expected specifier-qualifier-list before '__kernel_ulong_t'
---
Hi,
or is it a time to drop that support?
If I remember we were talking about 3.0, this is 3.4.
Is this correct?
+#ifndef __kernel_long_t
+# if defined(__x86_64__) && defined(__ILP32__)
+typedef long long __kernel_long_t;
+typedef unsigned long long __kernel_ulong_t;
+# else
+typedef long __kernel_long_t;
+typedef unsigned long __kernel_ulong_t;
+# endif
+#endif
Kind regards,
Petr
include/lapi/ipcbuf.h | 2 +- include/lapi/msgbuf.h | 2 +- include/lapi/posix_types.h | 21 +++++++++++++++++++++ include/lapi/sembuf.h | 2 +- include/lapi/shmbuf.h | 2 +- include/tst_timer.h | 7 +------ 6 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 include/lapi/posix_types.h
include/lapi/ipcbuf.h +1 -1
@@ -8,7 +8,7 @@#define IPCBUF_H #include "config.h" -#include <linux/posix_types.h> +#include "lapi/posix_types.h" #ifndef HAVE_IPC64_PERM
include/lapi/msgbuf.h +1 -1
@@ -7,7 +7,7 @@#ifndef IPC_MSGBUF_H #define IPC_MSGBUF_H -#include <linux/posix_types.h> +#include "lapi/posix_types.h" #include <sys/sem.h> #include "tst_timer.h" #include "ipcbuf.h"
include/lapi/posix_types.h new file +21 -0
@@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* +* Copyright (c) Linux Test Project, 2014-2019 +*/ + +#ifndef POSIX_TYPES_H__ +#define POSIX_TYPES_H__ + +#include <linux/posix_types.h> + +#ifndef __kernel_long_t +# if defined(__x86_64__) && defined(__ILP32__) +typedef long long __kernel_long_t ; +typedef unsigned long long __kernel_ulong_t ; +# else +typedef long __kernel_long_t ; +typedef unsigned long __kernel_ulong_t ; +# endif +#endif + +#endif /* POSIX_TYPES_H__ */
include/lapi/sembuf.h +1 -1
@@ -7,7 +7,7 @@#ifndef IPC_SEMBUF_H #define IPC_SEMBUF_H -#include <linux/posix_types.h> +#include "lapi/posix_types.h" #include <sys/sem.h> #include "tst_timer.h" #include "ipcbuf.h"
include/lapi/shmbuf.h +1 -1
@@ -7,7 +7,7 @@#ifndef IPC_SHMBUF_H #define IPC_SHMBUF_H -#include <linux/posix_types.h> +#include "lapi/posix_types.h" #include <sys/sem.h> #include "tst_timer.h" #include "ipcbuf.h"
include/tst_timer.h +1 -6
@@ -15,6 +15,7 @@#include <sys/time.h> #include <time.h> #include "tst_test.h" +#include "lapi/posix_types.h" #include "lapi/syscalls.h" /*
@@ -93,12 +94,6 @@ static inline long long tst_timeval_diff_ms(struct timeval t1,#ifndef __kernel_timespec -#if defined(__x86_64__) && defined(__ILP32__) -typedef long long __kernel_long_t ; -#else -typedef long __kernel_long_t ; -#endif -typedef __kernel_long_t __kernel_old_time_t ; struct __kernel_old_timespec {
Signature · 1 line
2.27.0
RFC PATCH 1/1 lapi: Add posix_types.h
Hi!
Quoted 20 lines
To fix undefined
__kernel_ulong_t, which was defined in v3.4-rc1 inafead38d011a("posix_types: Introduce __kernel_[u]long_t").This fixed build error:
In file included from
/usr/src/ltp/include/lapi/msgbuf.h:13,
from/usr/src/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c:9:/usr/src/ltp/include/lapi/ipcbuf.h: At top level:/usr/src/ltp/include/lapi/ipcbuf.h:187: error: expected specifier-qualifier-list before '__kernel_ulong_t'Fixes 3e1fc0644 ("include: Add declaration of struct ipc64_perm")Signed-off-by Petr Vorel <[email protected]>---
Hi,or is it a time to drop that support?
If I remember we were talking about 3.0, this is 3.4.Is this correct?
include/lapi/posix_types.h line 19
Quoted 9 lines
include/lapi/posix_types.h new file +9
-0+#ifndef __kernel_long_t +# if defined(__x86_64__) && defined(__ILP32__) +typedef long long __kernel_long_t ; +typedef unsigned long long __kernel_ulong_t ; +# else +typedef long __kernel_long_t ; +typedef unsigned long __kernel_ulong_t ; +# endif +#endif
As far as I can tell yes, I came to the same conclusion.
I guess that we may as well push this patch since you already put an effort into crafting it.
Signature · 2 lines
Cyril Hrubis [email protected]
RFC PATCH 1/1 lapi: Add posix_types.h
In reply to Petr VorelQuoted 33 lines · Petr Vorel
To fix undefined
__kernel_ulong_t, which was defined in v3.4-rc1 inafead38d011a("posix_types: Introduce __kernel_[u]long_t").This fixed build error:
In file included from
/usr/src/ltp/include/lapi/msgbuf.h:13,
from/usr/src/ltp/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c:9:/usr/src/ltp/include/lapi/ipcbuf.h: At top level:/usr/src/ltp/include/lapi/ipcbuf.h:187: error: expected specifier-qualifier-list before '__kernel_ulong_t'Fixes 3e1fc0644 ("include: Add declaration of struct ipc64_perm")Signed-off-by Petr Vorel <[email protected]>---
Hi,or is it a time to drop that support?
If I remember we were talking about 3.0, this is 3.4.Is this correct?
include/lapi/posix_types.h new file +9
-0+#ifndef __kernel_long_t +# if defined(__x86_64__) && defined(__ILP32__) +typedef long long __kernel_long_t ; +typedef unsigned long long __kernel_ulong_t ; +# else +typedef long __kernel_long_t ; +typedef unsigned long __kernel_ulong_t ; +# endif +#endif Kind regards,
Petr
Quoted 8 lines
include/lapi/ipcbuf.h | 2 +- include/lapi/msgbuf.h | 2 +- include/lapi/posix_types.h | 21 +++++++++++++++++++++ include/lapi/sembuf.h | 2 +- include/lapi/shmbuf.h | 2 +- include/tst_timer.h | 7 +------ 6 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 include/lapi/posix_types.h
Signature · 1 line
viresh
RFC PATCH 1/1 lapi: Add posix_types.h
Hi Cyril, Viresh,
thanks for your review, pushed.
Kind regards,
Petr