syscalls: Add tests to verify the _time_high fields
v2 cover syscalls: Add tests to verify the _time_high fields
Hello,
This patchset adds a new tests to three syscalls to verify that the extended fields, _time_high, are cleared by the kernel. This was suggested by Arnd.
V2:
- Separate out structure definitions to separate patches.
- Drop first two patches from V1 as they are already applied.
- Minor makefile fixes.
Viresh Kumar (6):
include: Add declaration of struct semid64_ds
syscalls: semctl: Add new test to verify the _time_high fields
include: Add declaration of struct shmid64_ds
syscalls: shmctl: Add new test to verify the _time_high fields
include: Add declaration of struct msqid64_ds
syscalls: msgctl: Add new test to verify the _time_high fields
configure.ac | 3 + include/lapi/msgbuf.h | 306 ++++++++++++++++++ include/lapi/sembuf.h | 234 ++++++++++++++ include/lapi/shmbuf.h | 273 ++++++++++++++++ runtest/syscalls | 3 + runtest/syscalls-ipc | 3 + .../kernel/syscalls/ipc/msgctl/.gitignore | 1 + .../kernel/syscalls/ipc/msgctl/msgctl05.c | 48 +++ .../kernel/syscalls/ipc/semctl/.gitignore | 1 + testcases/kernel/syscalls/ipc/semctl/Makefile | 5 +- .../kernel/syscalls/ipc/semctl/semctl08.c | 52 +++ .../kernel/syscalls/ipc/shmctl/.gitignore | 1 + testcases/kernel/syscalls/ipc/shmctl/Makefile | 5 +- .../kernel/syscalls/ipc/shmctl/shmctl06.c | 51 +++ 14 files changed, 983 insertions(+), 3 deletions(-) create mode 100644 include/lapi/msgbuf.h create mode 100644 include/lapi/sembuf.h create mode 100644 include/lapi/shmbuf.h create mode 100644 testcases/kernel/syscalls/ipc/msgctl/msgctl05.c create mode 100644 testcases/kernel/syscalls/ipc/semctl/semctl08.c create mode 100644 testcases/kernel/syscalls/ipc/shmctl/shmctl06.c
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
PATCH v2 1/6 include: Add declaration of struct semid64_ds
This adds declaration of struct semid64_ds, which will be used by following patches.
--- configure.ac | 1 + include/lapi/sembuf.h | 234 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) create mode 100644 include/lapi/sembuf.h
configure.ac +1 -0
@@ -151,6 +151,7 @@ AC_CHECK_TYPES([struct fs_quota_statv],,,[#include <xfs/xqm.h>]) AC_CHECK_TYPES([struct if_nextdqblk],,,[#include <linux/quota.h>]) AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>]) +AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>]) AC_CHECK_TYPES([struct mmsghdr],,,[ #define _GNU_SOURCE
include/lapi/sembuf.h new file +234 -0
234 lines not on this page · raw message
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
PATCH v2 2/6 syscalls: semctl: Add new test to verify the _time_high fields
In reply to Viresh KumarThe _time_high fields must be reset by the kernel, add a test to verify that.
--- runtest/syscalls | 1 + runtest/syscalls-ipc | 1 + .../kernel/syscalls/ipc/semctl/.gitignore | 1 + testcases/kernel/syscalls/ipc/semctl/Makefile | 5 +- .../kernel/syscalls/ipc/semctl/semctl08.c | 52 +++++++++++++++++++ 5 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 testcases/kernel/syscalls/ipc/semctl/semctl08.c
runtest/syscalls +1 -0
@@ -1157,6 +1157,7 @@ semctl04 semctl04 semctl05 semctl05 semctl06 semctl06 semctl07 semctl07 +semctl08 semctl08 semget01 semget01 semget02 semget02
runtest/syscalls-ipc +1 -0
@@ -33,6 +33,7 @@ semctl04 semctl04 semctl05 semctl05 semctl06 semctl06 semctl07 semctl07 +semctl08 semctl08 semget01 semget01 semget02 semget02
testcases/kernel/syscalls/ipc/semctl/.gitignore +1 -0
@@ -5,3 +5,4 @@ /semctl05 /semctl06 /semctl07 +/semctl08
testcases/kernel/syscalls/ipc/semctl/Makefile +3 -2
@@ -3,10 +3,11 @@ top_srcdir ?= ../../../../.. -LTPLIBS = ltpipc +LTPLIBS = ltpipc ltpnewipc include $(top_srcdir)/include/mk/testcases.mk -LDLIBS += -lltpipc +semctl01 semctl02 semctl03 semctl04 semctl05 semctl06 semctl07: LDLIBS += -lltpipc +semctl08: LDLIBS += -lltpnewipc include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/ipc/semctl/semctl08.c new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
PATCH v2 3/6 include: Add declaration of struct shmid64_ds
In reply to Viresh KumarThis adds declaration of struct shmid64_ds, which will be used by following patches.
--- configure.ac | 1 + include/lapi/shmbuf.h | 273 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 274 insertions(+) create mode 100644 include/lapi/shmbuf.h
configure.ac +1 -0
@@ -152,6 +152,7 @@ AC_CHECK_TYPES([struct if_nextdqblk],,,[#include <linux/quota.h>]) AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>]) AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>]) +AC_CHECK_TYPES([struct shmid64_ds],,,[#include <sys/shmbuf.h>]) AC_CHECK_TYPES([struct mmsghdr],,,[ #define _GNU_SOURCE
include/lapi/shmbuf.h new file +273 -0
273 lines not on this page · raw message
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
PATCH v2 4/6 syscalls: shmctl: Add new test to verify the _time_high fields
In reply to Viresh KumarThe _time_high fields must be reset by the kernel, add a test to verify that.
--- runtest/syscalls | 1 + runtest/syscalls-ipc | 1 + .../kernel/syscalls/ipc/shmctl/.gitignore | 1 + testcases/kernel/syscalls/ipc/shmctl/Makefile | 5 +- .../kernel/syscalls/ipc/shmctl/shmctl06.c | 51 +++++++++++++++++++ 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 testcases/kernel/syscalls/ipc/shmctl/shmctl06.c
runtest/syscalls +1 -0
@@ -1355,6 +1355,7 @@ shmctl02 shmctl02 shmctl03 shmctl03 shmctl04 shmctl04 shmctl05 shmctl05 +shmctl06 shmctl06 shmdt01 shmdt01 shmdt02 shmdt02
runtest/syscalls-ipc +1 -0
@@ -55,6 +55,7 @@ shmctl02 shmctl02 shmctl03 shmctl03 shmctl04 shmctl04 shmctl05 shmctl05 +shmctl06 shmctl06 shmdt01 shmdt01 shmdt02 shmdt02
testcases/kernel/syscalls/ipc/shmctl/.gitignore +1 -0
@@ -3,3 +3,4 @@ /shmctl03 /shmctl04 /shmctl05 +/shmctl06
testcases/kernel/syscalls/ipc/shmctl/Makefile +4 -1
@@ -3,13 +3,16 @@ top_srcdir ?= ../../../../.. -LTPLIBS = ltpipc +LTPLIBS = ltpipc ltpnewipc shmctl05: CFLAGS += -pthread shmctl05: LDLIBS += -lrt include $(top_srcdir)/include/mk/testcases.mk +shmctl01 shmctl02 shmctl03 shmctl04 shmctl05: LDLIBS += -lltpipc +shmctl06: LDLIBS += -lltpnewipc + LDLIBS += -lltpipc include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/ipc/shmctl/shmctl06.c new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
PATCH v2 5/6 include: Add declaration of struct msqid64_ds
In reply to Viresh KumarThis adds declaration of struct msqid64_ds, which will be used by following patches.
--- configure.ac | 1 + include/lapi/msgbuf.h | 306 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 307 insertions(+) create mode 100644 include/lapi/msgbuf.h
configure.ac +1 -0
@@ -153,6 +153,7 @@ AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>]) AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>]) AC_CHECK_TYPES([struct shmid64_ds],,,[#include <sys/shmbuf.h>]) +AC_CHECK_TYPES([struct msqid64_ds],,,[#include <sys/msgbuf.h>]) AC_CHECK_TYPES([struct mmsghdr],,,[ #define _GNU_SOURCE
include/lapi/msgbuf.h new file +306 -0
306 lines not on this page · raw message
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
PATCH v2 5/6 include: Add declaration of struct msqid64_ds
Hi Viresh,
configure.ac AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) · line 156
Quoted 6 lines
+++ b/configure.ac
configure.ac +1
-0@@ -153,6 +153,7 @@ AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>]) AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>]) AC_CHECK_TYPES([struct shmid64_ds],,,[#include <sys/shmbuf.h>]) +AC_CHECK_TYPES([struct msqid64_ds],,,[#include <sys/msgbuf.h>])
NOTE (for next time): we try to keep items in configure.ac alphabetically sorted :).
Kind regards,
Petr
PATCH v2 5/6 include: Add declaration of struct msqid64_ds
Quoted 10 lines · Petr Vorel
Hi Viresh,
configure.ac AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) · line 156
Quoted 6 lines
+++ b/configure.ac
configure.ac +1
-0@@ -153,6 +153,7 @@ AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>]) AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>]) AC_CHECK_TYPES([struct semid64_ds],,,[#include <sys/sem.h>]) AC_CHECK_TYPES([struct shmid64_ds],,,[#include <sys/shmbuf.h>]) +AC_CHECK_TYPES([struct msqid64_ds],,,[#include <sys/msgbuf.h>])NOTE (for next time): we try to keep items in configure.ac alphabetically sorted :).
I normally keep such things sorted, looks like I need to watch some "ABCD" youtube videos with my 3 yrs old daughter now :)
Signature · 1 line
viresh
PATCH v2 6/6 syscalls: msgctl: Add new test to verify the _time_high fields
In reply to Viresh KumarThe _time_high fields must be reset by the kernel, add a test to verify that.
--- runtest/syscalls | 1 + runtest/syscalls-ipc | 1 + .../kernel/syscalls/ipc/msgctl/.gitignore | 1 + .../kernel/syscalls/ipc/msgctl/msgctl05.c | 48 +++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
runtest/syscalls +1 -0
@@ -797,6 +797,7 @@ msgctl01 msgctl01 msgctl02 msgctl02 msgctl03 msgctl03 msgctl04 msgctl04 +msgctl05 msgctl05 msgstress01 msgstress01 msgstress02 msgstress02 msgstress03 msgstress03
runtest/syscalls-ipc +1 -0
@@ -2,6 +2,7 @@ msgctl01 msgctl01 msgctl02 msgctl02 msgctl03 msgctl03 msgctl04 msgctl04 +msgctl05 msgctl05 msgstress01 msgstress01 msgstress02 msgstress02 msgstress03 msgstress03
testcases/kernel/syscalls/ipc/msgctl/.gitignore +1 -0
@@ -2,4 +2,5 @@ /msgctl02 /msgctl03 /msgctl04 +/msgctl05 /msgctl12
testcases/kernel/syscalls/ipc/msgctl/msgctl05.c new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.25.0.rc1.19.g042ed3e048af
v2 cover syscalls: Add tests to verify the _time_high fields
In reply to Viresh KumarHi!
I've added one more patch that includes config.h in the include/lapi/ipcbuf.h, since otherwise we may not get the HAVE_* macros defined and pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]
v2 cover syscalls: Add tests to verify the _time_high fields
Hi!
Looking at the travis it looks like we do have a problem with missing __kernel_ulong_t on older kernel headers:
https://api.travis-ci.org/v3/job/698929344/log.txt
Also looking into kernel headers it looks like it's defined to unsigned long unless on x32 which has unsigned long long. It seems that the types __kernel_long_t and __kernel_ulong_t firstly appeared in 3.4 along with the x32 so I guess that we will need a fallback definition in UAPI as well. And given that __kernel_long_t is defined we may need something as lapi/posix_types.h with:
#include "linux/posix_types.h"
#ifndef __kernel_long_t
# if (defined(__x86_64__) && defined(__ILP32__)) typedef long __kernel_long_t typedef unsigned long __kernel_ulong_t # else typedef long long __kernel_long_t typedef unsigned long long __kernel_ulong_t # endif #endif
Is that all or do I miss some 32bit ABI with 64bit syscalls?
Signature · 2 lines
Cyril Hrubis [email protected]
v2 cover syscalls: Add tests to verify the _time_high fields
Quoted 26 lines · Cyril Hrubis
Hi!
Looking at the travis it looks like we do have a problem with missing__kernel_ulong_ton older kernel headers:https://api.travis-ci.org/v3/job/698929344/log.txt
Also looking into kernel headers it looks like it's defined to unsigned long unless on x32 which has unsigned long long. It seems that the types
__kernel_long_tand__kernel_ulong_tfirstly appeared in 3.4 along with the x32 so I guess that we will need a fallback definition in UAPI as well. And given that__kernel_long_tis defined we may need something aslapi/posix_types.hwith:#include "
linux/posix_types.h"#ifndef
__kernel_long_t# if (defined(__x86_64__) && defined(__ILP32__)) typedef long __kernel_long_t typedef unsigned long __kernel_ulong_t # else typedef long long __kernel_long_t typedef unsigned long long __kernel_ulong_t # endif #endif
Quoted 1 line
Is that all or do I miss some 32bit ABI with 64bit syscalls?
That should do I believe. Part of this is already present in tst_timer.h btw.
Signature · 1 line
viresh