All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] Fixes for old distros
@ 2020-01-17 11:37 Petr Vorel
  2020-01-17 11:37 ` [LTP] [PATCH 1/3] pidfd_send_signal: Build with _GNU_SOURCE Petr Vorel
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Petr Vorel @ 2020-01-17 11:37 UTC (permalink / raw)
  To: ltp

Hi,

few fixes for old SLES we still support,
which I'd like to merge before release.

Kind regards,
Petr

Petr Vorel (3):
  pidfd_send_signal: Build with _GNU_SOURCE
  tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  lapi/syscalls: Add syncfs

 include/lapi/syscalls/arm.in                                    | 1 +
 include/lapi/syscalls/hppa.in                                   | 1 +
 include/lapi/syscalls/i386.in                                   | 1 +
 include/lapi/syscalls/ia64.in                                   | 1 +
 include/lapi/syscalls/powerpc.in                                | 1 +
 include/lapi/syscalls/powerpc64.in                              | 1 +
 include/lapi/syscalls/s390.in                                   | 1 +
 include/lapi/syscalls/s390x.in                                  | 1 +
 include/lapi/syscalls/sh.in                                     | 1 +
 include/lapi/syscalls/sparc.in                                  | 1 +
 include/lapi/syscalls/sparc64.in                                | 1 +
 include/lapi/syscalls/x86_64.in                                 | 1 +
 include/tst_device.h                                            | 2 +-
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c     | 1 +
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c     | 1 +
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c     | 1 +
 16 files changed, 16 insertions(+), 1 deletion(-)

-- 
2.24.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 1/3] pidfd_send_signal: Build with _GNU_SOURCE
  2020-01-17 11:37 [LTP] [PATCH 0/3] Fixes for old distros Petr Vorel
@ 2020-01-17 11:37 ` Petr Vorel
  2020-01-17 11:37 ` [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h> Petr Vorel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Petr Vorel @ 2020-01-17 11:37 UTC (permalink / raw)
  To: ltp

This adds missing O_CLOEXEC and O_DIRECTORY on old distros,
where it's (in glibc) guarded under __USE_GNU.

This was needed on SLES 11 (glibc 2.11).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c      | 1 +
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c      | 1 +
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c      | 1 +
 3 files changed, 3 insertions(+)

diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c
index f03905894..b529551d2 100644
--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c
+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c
@@ -9,6 +9,7 @@
  * struct is passed.
  */
 
+#define _GNU_SOURCE
 #include <signal.h>
 #include <stdlib.h>
 #include "tst_safe_pthread.h"
diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c
index c933ada84..74914523f 100644
--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c
+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal02.c
@@ -21,6 +21,7 @@
  *    -> EPERM
  */
 
+#define _GNU_SOURCE
 #include <pwd.h>
 #include <signal.h>
 #include "tst_safe_pthread.h"
diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
index 19d943d06..3420afbb9 100644
--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
@@ -15,6 +15,7 @@
  * child using the pidfd of the first one.
  */
 
+#define _GNU_SOURCE
 #include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-17 11:37 [LTP] [PATCH 0/3] Fixes for old distros Petr Vorel
  2020-01-17 11:37 ` [LTP] [PATCH 1/3] pidfd_send_signal: Build with _GNU_SOURCE Petr Vorel
@ 2020-01-17 11:37 ` Petr Vorel
  2020-01-20 10:31   ` Petr Vorel
  2020-01-17 11:37 ` [LTP] [PATCH 3/3] lapi/syscalls: Add syncfs Petr Vorel
  2020-01-17 12:15 ` [LTP] [PATCH 0/3] Fixes for old distros Jan Stancek
  3 siblings, 1 reply; 12+ messages in thread
From: Petr Vorel @ 2020-01-17 11:37 UTC (permalink / raw)
  To: ltp

As a fallback for old distros which does not define __NR_syncfs
(the dependency is in the library itself).

This was needed on SLES 11 (kernel 2.6.32).

Fixes: 74aeb88c9 ("tst_device: use raw syscall in the tst_device.h")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/tst_device.h b/include/tst_device.h
index 3db5275c9..13d92ee54 100644
--- a/include/tst_device.h
+++ b/include/tst_device.h
@@ -19,7 +19,7 @@
 #define TST_DEVICE_H__
 
 #include <unistd.h>
-#include <sys/syscall.h>
+#include "lapi/syscalls.h"
 
 struct tst_device {
 	const char *dev;
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 3/3] lapi/syscalls: Add syncfs
  2020-01-17 11:37 [LTP] [PATCH 0/3] Fixes for old distros Petr Vorel
  2020-01-17 11:37 ` [LTP] [PATCH 1/3] pidfd_send_signal: Build with _GNU_SOURCE Petr Vorel
  2020-01-17 11:37 ` [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h> Petr Vorel
@ 2020-01-17 11:37 ` Petr Vorel
  2020-01-17 12:15 ` [LTP] [PATCH 0/3] Fixes for old distros Jan Stancek
  3 siblings, 0 replies; 12+ messages in thread
From: Petr Vorel @ 2020-01-17 11:37 UTC (permalink / raw)
  To: ltp

for old distros, which don't define it. Added for all architectures
(including very old ones), as the dependency is in the library itself.

This was needed on SLES 11 (kernel 2.6.32).

Fixes: 74aeb88c9 ("tst_device: use raw syscall in the tst_device.h")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/lapi/syscalls/arm.in       | 1 +
 include/lapi/syscalls/hppa.in      | 1 +
 include/lapi/syscalls/i386.in      | 1 +
 include/lapi/syscalls/ia64.in      | 1 +
 include/lapi/syscalls/powerpc.in   | 1 +
 include/lapi/syscalls/powerpc64.in | 1 +
 include/lapi/syscalls/s390.in      | 1 +
 include/lapi/syscalls/s390x.in     | 1 +
 include/lapi/syscalls/sh.in        | 1 +
 include/lapi/syscalls/sparc.in     | 1 +
 include/lapi/syscalls/sparc64.in   | 1 +
 include/lapi/syscalls/x86_64.in    | 1 +
 12 files changed, 12 insertions(+)

diff --git a/include/lapi/syscalls/arm.in b/include/lapi/syscalls/arm.in
index 00e99f2b9..a6a594c2e 100644
--- a/include/lapi/syscalls/arm.in
+++ b/include/lapi/syscalls/arm.in
@@ -334,6 +334,7 @@ accept4 (__NR_SYSCALL_BASE+366)
 fanotify_init (__NR_SYSCALL_BASE+367)
 fanotify_mark (__NR_SYSCALL_BASE+368)
 prlimit64 (__NR_SYSCALL_BASE+369)
+syncfs (__NR_SYSCALL_BASE+373)
 process_vm_readv (__NR_SYSCALL_BASE+376)
 process_vm_writev (__NR_SYSCALL_BASE+377)
 kcmp (__NR_SYSCALL_BASE+378)
diff --git a/include/lapi/syscalls/hppa.in b/include/lapi/syscalls/hppa.in
index 4cdd109fb..d92f33f40 100644
--- a/include/lapi/syscalls/hppa.in
+++ b/include/lapi/syscalls/hppa.in
@@ -16,6 +16,7 @@ faccessat (__NR_openat + 12)
 splice 291
 tee 293
 vmsplice 294
+syncfs 327
 process_vm_readv 330
 process_vm_writev 331
 memfd_create 340
diff --git a/include/lapi/syscalls/i386.in b/include/lapi/syscalls/i386.in
index 87ab46933..bad6e409f 100644
--- a/include/lapi/syscalls/i386.in
+++ b/include/lapi/syscalls/i386.in
@@ -332,6 +332,7 @@ recvmmsg 337
 fanotify_init 338
 fanotify_mark 339
 prlimit64 340
+syncfs 344
 process_vm_readv 347
 process_vm_writev 348
 kcmp 349
diff --git a/include/lapi/syscalls/ia64.in b/include/lapi/syscalls/ia64.in
index cf9f73e85..0e6ba54a8 100644
--- a/include/lapi/syscalls/ia64.in
+++ b/include/lapi/syscalls/ia64.in
@@ -293,6 +293,7 @@ recvmmsg 1322
 fanotify_init 1323
 fanotify_mark 1324
 prlimit64 1325
+syncfs 1329
 process_vm_readv 1332
 process_vm_writev 1333
 renameat2 1338
diff --git a/include/lapi/syscalls/powerpc.in b/include/lapi/syscalls/powerpc.in
index 660165d7a..91467f326 100644
--- a/include/lapi/syscalls/powerpc.in
+++ b/include/lapi/syscalls/powerpc.in
@@ -339,6 +339,7 @@ recvmsg 342
 recvmmsg 343
 accept4 344
 syscalls 345
+syncfs 348
 process_vm_readv  351
 process_vm_writev 352
 kcmp 354
diff --git a/include/lapi/syscalls/powerpc64.in b/include/lapi/syscalls/powerpc64.in
index 660165d7a..91467f326 100644
--- a/include/lapi/syscalls/powerpc64.in
+++ b/include/lapi/syscalls/powerpc64.in
@@ -339,6 +339,7 @@ recvmsg 342
 recvmmsg 343
 accept4 344
 syscalls 345
+syncfs 348
 process_vm_readv  351
 process_vm_writev 352
 kcmp 354
diff --git a/include/lapi/syscalls/s390.in b/include/lapi/syscalls/s390.in
index d3f7eb1f6..dcf0a7148 100644
--- a/include/lapi/syscalls/s390.in
+++ b/include/lapi/syscalls/s390.in
@@ -323,6 +323,7 @@ setgid 214
 setfsuid 215
 setfsgid 216
 newfstatat 293
+syncfs 338
 process_vm_readv 340
 process_vm_writev 341
 kcmp 343
diff --git a/include/lapi/syscalls/s390x.in b/include/lapi/syscalls/s390x.in
index 7d632d1dc..2dce00f90 100644
--- a/include/lapi/syscalls/s390x.in
+++ b/include/lapi/syscalls/s390x.in
@@ -322,6 +322,7 @@ setgid 214
 setfsuid 215
 setfsgid 216
 newfstatat 293
+syncfs 338
 process_vm_readv 340
 process_vm_writev 341
 kcmp 343
diff --git a/include/lapi/syscalls/sh.in b/include/lapi/syscalls/sh.in
index 132492922..996ebc956 100644
--- a/include/lapi/syscalls/sh.in
+++ b/include/lapi/syscalls/sh.in
@@ -360,6 +360,7 @@ accept4 366
 fanotify_init 367
 fanotify_mark 368
 prlimit64 369
+syncfs 373
 process_vm_readv 376
 process_vm_writev 377
 kcmp 378
diff --git a/include/lapi/syscalls/sparc.in b/include/lapi/syscalls/sparc.in
index 94a672428..65902e00a 100644
--- a/include/lapi/syscalls/sparc.in
+++ b/include/lapi/syscalls/sparc.in
@@ -330,6 +330,7 @@ recvmmsg 328
 fanotify_init 329
 fanotify_mark 330
 prlimit64 331
+syncfs 335
 process_vm_readv 338
 process_vm_writev 339
 kcmp 341
diff --git a/include/lapi/syscalls/sparc64.in b/include/lapi/syscalls/sparc64.in
index d17dce5cd..d303622b4 100644
--- a/include/lapi/syscalls/sparc64.in
+++ b/include/lapi/syscalls/sparc64.in
@@ -306,6 +306,7 @@ recvmmsg 328
 fanotify_init 329
 fanotify_mark 330
 prlimit64 331
+syncfs 335
 process_vm_readv 338
 process_vm_writev 339
 kcmp 341
diff --git a/include/lapi/syscalls/x86_64.in b/include/lapi/syscalls/x86_64.in
index b1cbd4f2f..3e9e19ae6 100644
--- a/include/lapi/syscalls/x86_64.in
+++ b/include/lapi/syscalls/x86_64.in
@@ -299,6 +299,7 @@ recvmmsg 299
 fanotify_init 300
 fanotify_mark 301
 prlimit64 302
+syncfs 306
 process_vm_readv 310
 process_vm_writev 311
 kcmp 312
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 0/3] Fixes for old distros
  2020-01-17 11:37 [LTP] [PATCH 0/3] Fixes for old distros Petr Vorel
                   ` (2 preceding siblings ...)
  2020-01-17 11:37 ` [LTP] [PATCH 3/3] lapi/syscalls: Add syncfs Petr Vorel
@ 2020-01-17 12:15 ` Jan Stancek
  2020-01-17 15:53   ` Petr Vorel
  3 siblings, 1 reply; 12+ messages in thread
From: Jan Stancek @ 2020-01-17 12:15 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> Hi,
> 
> few fixes for old SLES we still support,
> which I'd like to merge before release.

Looks good to me.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 0/3] Fixes for old distros
  2020-01-17 12:15 ` [LTP] [PATCH 0/3] Fixes for old distros Jan Stancek
@ 2020-01-17 15:53   ` Petr Vorel
  0 siblings, 0 replies; 12+ messages in thread
From: Petr Vorel @ 2020-01-17 15:53 UTC (permalink / raw)
  To: ltp

Hi Jan,

> > few fixes for old SLES we still support,
> > which I'd like to merge before release.

> Looks good to me.
Thanks for your review, merged.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-17 11:37 ` [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h> Petr Vorel
@ 2020-01-20 10:31   ` Petr Vorel
  2020-01-20 10:56     ` Jan Stancek
  0 siblings, 1 reply; 12+ messages in thread
From: Petr Vorel @ 2020-01-20 10:31 UTC (permalink / raw)
  To: ltp

Hi,

> As a fallback for old distros which does not define __NR_syncfs
> (the dependency is in the library itself).

> This was needed on SLES 11 (kernel 2.6.32).

> Fixes: 74aeb88c9 ("tst_device: use raw syscall in the tst_device.h")

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  include/tst_device.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/include/tst_device.h b/include/tst_device.h
> index 3db5275c9..13d92ee54 100644
> --- a/include/tst_device.h
> +++ b/include/tst_device.h
> @@ -19,7 +19,7 @@
>  #define TST_DEVICE_H__

>  #include <unistd.h>
> -#include <sys/syscall.h>
> +#include "lapi/syscalls.h"
Hm, maybe this fix wasn't a good idea.
It effectively uses lapi/syscalls.h everywhere instead of <sys/syscall.h>.
Not sure if this is what we want.

Example of the error is #634 [1], which is caused by __NR_socketcall being -1
instead of not defined (socketcall is not defined on some archs, e.g. x86-64 and ARM).
We can fix the condition, but it will lead to numerous not obvious errors, so I
suggest to revert this (and thus get LTP broken on very old distros).

I'm sorry to break LTP just before release.

Kind regards,
Petr

[1] https://github.com/linux-test-project/ltp/issues/634

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-20 10:31   ` Petr Vorel
@ 2020-01-20 10:56     ` Jan Stancek
  2020-01-20 12:03       ` Petr Vorel
  2020-01-20 12:28       ` Cyril Hrubis
  0 siblings, 2 replies; 12+ messages in thread
From: Jan Stancek @ 2020-01-20 10:56 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> >  #include <unistd.h>
> > -#include <sys/syscall.h>
> > +#include "lapi/syscalls.h"
> Hm, maybe this fix wasn't a good idea.
> It effectively uses lapi/syscalls.h everywhere instead of <sys/syscall.h>.
> Not sure if this is what we want.

We already include lapi/syscalls.h at several places, so I wouldn't expect
this to be as bad.

> 
> Example of the error is #634 [1], which is caused by __NR_socketcall being -1
> instead of not defined (socketcall is not defined on some archs, e.g. x86-64
> and ARM).
> We can fix the condition

Tests using tst_syscall or ltp_syscall should be fine, since those check
for ENOSYS.

>, but it will lead to numerous not obvious errors, so
> I
> suggest to revert this (and thus get LTP broken on very old distros).
> 

Cyril, any thoughts?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-20 10:56     ` Jan Stancek
@ 2020-01-20 12:03       ` Petr Vorel
  2020-01-20 12:30         ` Martin Doucha
  2020-01-20 12:28       ` Cyril Hrubis
  1 sibling, 1 reply; 12+ messages in thread
From: Petr Vorel @ 2020-01-20 12:03 UTC (permalink / raw)
  To: ltp

Hi,

> ----- Original Message -----
> > >  #include <unistd.h>
> > > -#include <sys/syscall.h>
> > > +#include "lapi/syscalls.h"
> > Hm, maybe this fix wasn't a good idea.
> > It effectively uses lapi/syscalls.h everywhere instead of <sys/syscall.h>.
> > Not sure if this is what we want.

> We already include lapi/syscalls.h at several places, so I wouldn't expect
> this to be as bad.

Yes, it's in many places, the same as lapi/syscalls.h:
git grep -l sys/syscall.h |wc -l
136

git grep -l lapi/syscalls.h |wc -l
206

But none of lapi/syscalls.h use is in the API headers (only in API C and tests)

> > Example of the error is #634 [1], which is caused by __NR_socketcall being -1
> > instead of not defined (socketcall is not defined on some archs, e.g. x86-64
> > and ARM).
> > We can fix the condition

> Tests using tst_syscall or ltp_syscall should be fine, since those check
> for ENOSYS.
OK, if lapi/syscalls.h include is ok, using tst_syscall() in socketcall01.c is
trivial fix. But I'd worry about these uses:

$ git grep -e '^#if.*\bSYS_' $(git grep -l sys/syscall.h)
testcases/kernel/containers/libclone/libclone.h:#ifndef SYS_unshare
testcases/kernel/containers/libclone/libclone.h:#ifdef __NR_unshare
testcases/kernel/containers/libclone/libclone.h:#ifndef __NR_unshare
testcases/kernel/fs/scsi/ltpscsi/llseek.c:#ifdef __NR_lseek
testcases/kernel/fs/scsi/ltpscsi/llseek.c:#ifndef __NR_llseek
testcases/kernel/hotplug/memory_hotplug/commands.c:#ifndef __NR_migrate_pages
testcases/kernel/mem/vma/vma03.c:#ifdef __NR_mmap2
testcases/kernel/security/tomoyo/include.h:#ifdef __NR_uselib
testcases/kernel/security/tomoyo/include.h:#ifdef __NR_pivot_root
testcases/kernel/syscalls/accept4/accept4_01.c:#if defined(SYS_ACCEPT4) /* the socketcall() number */
testcases/kernel/syscalls/readahead/readahead01.c:#if defined(__NR_readahead)
testcases/kernel/syscalls/set_robust_list/set_robust_list01.c:#ifdef __NR_set_robust_list
testcases/kernel/syscalls/set_robust_list/set_robust_list01.c:#ifdef __NR_set_robust_list
testcases/kernel/syscalls/set_robust_list/set_robust_list01.c:#ifdef __NR_set_robust_list
testcases/kernel/syscalls/set_robust_list/set_robust_list01.c:#ifdef __NR_set_robust_list
testcases/kernel/syscalls/setns/setns01.c:#if defined(__NR_setns)
testcases/kernel/syscalls/setns/setns02.c:#if defined(__NR_setns) && defined(CLONE_NEWIPC) && defined(CLONE_NEWUTS)
testcases/kernel/syscalls/socketcall/socketcall01.c:#ifdef __NR_socketcall
testcases/kernel/syscalls/socketcall/socketcall02.c:#ifdef __NR_socketcall
testcases/kernel/syscalls/socketcall/socketcall03.c:#ifdef __NR_socketcall
testcases/kernel/syscalls/socketcall/socketcall04.c:#ifdef __NR_socketcall
testcases/kernel/syscalls/timerfd/timerfd01.c:#ifdef __NR_timerfd_create
testcases/misc/crash/crash02.c:#if defined(__NR_vfork) && __NR_vfork
testcases/misc/crash/crash02.c:#if defined(__NR_clone) && __NR_clone

which IMHO fail unless transformed into tst_syscall/ltp_syscall().

That's why I'd apply my fix https://patchwork.ozlabs.org/patch/1225869/.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-20 10:56     ` Jan Stancek
  2020-01-20 12:03       ` Petr Vorel
@ 2020-01-20 12:28       ` Cyril Hrubis
  1 sibling, 0 replies; 12+ messages in thread
From: Cyril Hrubis @ 2020-01-20 12:28 UTC (permalink / raw)
  To: ltp

Hi!
> > Example of the error is #634 [1], which is caused by __NR_socketcall being -1
> > instead of not defined (socketcall is not defined on some archs, e.g. x86-64
> > and ARM).
> > We can fix the condition
> 
> Tests using tst_syscall or ltp_syscall should be fine, since those check
> for ENOSYS.
> 
> >, but it will lead to numerous not obvious errors, so
> > I
> > suggest to revert this (and thus get LTP broken on very old distros).
> > 
> 
> Cyril, any thoughts?

I would say that doing #ifdef __NR_* in test source to disable it is
wrong to begin with.

Doing 'git grep ifdef __NR' shows only socketcall, set_robust_list and
timerfd tests.

The timerfd tests include lapi/syscalls.h already and uses ltp_syscall()
so that shouldn't break. I guess we can safely remove the ifdef there as
well.

The set_robust_list includes the old test.h so thi change to
tst_device.h should not affect it either.

So as far as I can tell the only thing that breaks are the socketcall
tests and I guess that the actual fix would be using tst_syscall()
instead of syscall() and we can remove the ifdefs as well.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-20 12:03       ` Petr Vorel
@ 2020-01-20 12:30         ` Martin Doucha
  2020-01-20 13:04           ` Petr Vorel
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Doucha @ 2020-01-20 12:30 UTC (permalink / raw)
  To: ltp

On 1/20/20 1:03 PM, Petr Vorel wrote:
> But none of lapi/syscalls.h use is in the API headers (only in API C and tests)

And you could avoid #including lapi/syscalls.h in API headers by simply
moving the implementation of tst_dev_sync() to lib/tst_device.c.

Why do you guys use static inline functions so much anyway? There are no
technical reasons to do that except for default main().

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>
  2020-01-20 12:30         ` Martin Doucha
@ 2020-01-20 13:04           ` Petr Vorel
  0 siblings, 0 replies; 12+ messages in thread
From: Petr Vorel @ 2020-01-20 13:04 UTC (permalink / raw)
  To: ltp

Hi,

> On 1/20/20 1:03 PM, Petr Vorel wrote:
> > But none of lapi/syscalls.h use is in the API headers (only in API C and tests)

> And you could avoid #including lapi/syscalls.h in API headers by simply
> moving the implementation of tst_dev_sync() to lib/tst_device.c.

> Why do you guys use static inline functions so much anyway? There are no
> technical reasons to do that except for default main().

+1. I still think it's not good to include lapi/syscalls.h even it does not
break anything. I'll send a patch which uses tst_syscall in socketcall01.c and
second commit which moves tst_dev_sync() to lib/tst_device.c.
It's up to you if agree on second one.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-01-20 13:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 11:37 [LTP] [PATCH 0/3] Fixes for old distros Petr Vorel
2020-01-17 11:37 ` [LTP] [PATCH 1/3] pidfd_send_signal: Build with _GNU_SOURCE Petr Vorel
2020-01-17 11:37 ` [LTP] [PATCH 2/3] tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h> Petr Vorel
2020-01-20 10:31   ` Petr Vorel
2020-01-20 10:56     ` Jan Stancek
2020-01-20 12:03       ` Petr Vorel
2020-01-20 12:30         ` Martin Doucha
2020-01-20 13:04           ` Petr Vorel
2020-01-20 12:28       ` Cyril Hrubis
2020-01-17 11:37 ` [LTP] [PATCH 3/3] lapi/syscalls: Add syncfs Petr Vorel
2020-01-17 12:15 ` [LTP] [PATCH 0/3] Fixes for old distros Jan Stancek
2020-01-17 15:53   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.