mbox series

[V2,0/6] syscalls: Add tests to verify the _time_high fields

Message ID cover.1592302358.git.viresh.kumar@linaro.org
Headers show
Series syscalls: Add tests to verify the _time_high fields | expand

Message

Viresh Kumar June 16, 2020, 10:20 a.m. UTC
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

Comments

Cyril Hrubis June 16, 2020, 1:10 p.m. UTC | #1
Hi!
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.
Cyril Hrubis June 16, 2020, 2:29 p.m. UTC | #2
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?
Viresh Kumar June 17, 2020, 4:49 a.m. UTC | #3
On 16-06-20, 16:29, Cyril Hrubis wrote:
> 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?

That should do I believe. Part of this is already present in
tst_timer.h btw.