Skip to contentSkip to conversation

syscall: System call numbers are word sized

PATCH In review Richard Palethorpe via ltp 3 participants 6 messages Jan 10, 2023 – Jan 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 syscall: System call numbers are word sized

---
 include/lapi/syscalls/regen.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/lapi/syscalls/regen.sh +2 -2
index 97027e2f3..217595f34 100755
@@ -38,12 +38,12 @@ cat << EOF > "${output_pid}"
 #ifdef TST_TEST_H__
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
 	tst_brk(TCONF, \\
-		"syscall(%d) " SNR " not supported on your arch", NR); \\
+		"syscall(%ld) " SNR " not supported on your arch", NR); \\
 })
 #else
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
 	tst_brkm(TCONF, CLEANUP, \\
-		"syscall(%d) " SNR " not supported on your arch", NR); \\
+		"syscall(%ld) " SNR " not supported on your arch", NR); \\
 })
 #endif
 
Signature · 5 lines
2.39.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH 2/2 fcntl{34, 36}: Always use 64-bit flock struct to avoid EINVAL

Recently we switched to using struct fcntl with _FILE_OFFSET_BITS instead of the transitional type fcntl64 which has been removed from some libcs.

This broke testing with 32-bit executables on a 64bit kernel when FILE_OFFSET_BITS was not set to 64. Because the fcntl64 syscall does not exist on 64 bit kernels.

The reason we are making the syscall directly is because of old glibc's which don't do any conversion.

So we now do a conversion unconditionally and call fcntl64 if the kernel is 32-bit.

When we no longer support old glibcs we can drop this compat function altogether.

---
 testcases/kernel/syscalls/fcntl/fcntl34.c     |  8 +-
 testcases/kernel/syscalls/fcntl/fcntl36.c     |  8 +-
 .../kernel/syscalls/fcntl/fcntl_common.h      | 79 +++++++++++++------
 3 files changed, 63 insertions(+), 32 deletions(-)
testcases/kernel/syscalls/fcntl/fcntl34.c +3 -5
index 8d5e22b72..45e693fe6 100644
@@ -10,10 +10,8 @@
 #include <pthread.h>
 #include <sched.h>
 
-#include "lapi/fcntl.h"
-#include "tst_safe_pthread.h"
-#include "tst_test.h"
 #include "fcntl_common.h"
+#include "tst_safe_pthread.h"
 
 static int thread_cnt;
 static const int max_thread_cnt = 32;
@@ -62,13 +60,13 @@ void *thread_fn_01(void *arg)
 
 	for (i = 0; i < writes_num; ++i) {
 		lck.l_type = F_WRLCK;
-		my_fcntl(fd, F_OFD_SETLKW, &lck);
+		FCNTL_COMPAT(fd, F_OFD_SETLKW, &lck);
 
 		SAFE_LSEEK(fd, 0, SEEK_END);
 		SAFE_WRITE(SAFE_WRITE_ALL, fd, buf, write_size);
 
 		lck.l_type = F_UNLCK;
-		my_fcntl(fd, F_OFD_SETLKW, &lck);
+		FCNTL_COMPAT(fd, F_OFD_SETLKW, &lck);
 
 		sched_yield();
 	}
testcases/kernel/syscalls/fcntl/fcntl36.c +4 -4
index 067eaee64..e84b7ed0c 100644
@@ -84,13 +84,13 @@ static void *fn_ofd_w(void *arg)
 		memset(buf, wt, pa->length);
 
 		lck.l_type = F_WRLCK;
-		my_fcntl(fd, F_OFD_SETLKW, &lck);
+		FCNTL_COMPAT(fd, F_OFD_SETLKW, &lck);
 
 		SAFE_LSEEK(fd, pa->offset, SEEK_SET);
 		SAFE_WRITE(SAFE_WRITE_ALL, fd, buf, pa->length);
 
 		lck.l_type = F_UNLCK;
-		my_fcntl(fd, F_OFD_SETLKW, &lck);
+		FCNTL_COMPAT(fd, F_OFD_SETLKW, &lck);
 
 		wt++;
 		if (wt >= 255)
@@ -163,7 +163,7 @@ static void *fn_ofd_r(void *arg)
 		memset(buf, 0, pa->length);
 
 		lck.l_type = F_RDLCK;
-		my_fcntl(fd, F_OFD_SETLKW, &lck);
+		FCNTL_COMPAT(fd, F_OFD_SETLKW, &lck);
 
 		/* rlock acquired */
 		SAFE_LSEEK(fd, pa->offset, SEEK_SET);
@@ -194,7 +194,7 @@ static void *fn_ofd_r(void *arg)
 		}
 
 		lck.l_type = F_UNLCK;
-		my_fcntl(fd, F_OFD_SETLK, &lck);
+		FCNTL_COMPAT(fd, F_OFD_SETLK, &lck);
 
 		sched_yield();
 	}
testcases/kernel/syscalls/fcntl/fcntl_common.h +56 -23

94 lines not on this page · raw message

Signature · 5 lines
2.39.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by Tested-by on v1 2/2
#2 lore raw

Re: [LTP] [PATCH 2/2] fcntl{34, 36}: Always use 64-bit flock struct to avoid EINVAL

Hi Richie,

[ Cc Khem Raj ]

Quoted 3 lines

Recently we switched to using struct fcntl with _FILE_OFFSET_BITS instead of the transitional type fcntl64 which has been removed from some libcs.

Do you mean b0320456cd ("testcases: Fix largefile support") ? Because this commit really broke both 32 bit emulation
+ (obviously) LTP on native 32bit.

Please add before merge:

Fixes b0320456c ("testcases: Fix largefile support")

(although this needs also previous fix)

Quoted 9 lines

This broke testing with 32-bit executables on a 64bit kernel when FILE_OFFSET_BITS was not set to 64. Because the fcntl64 syscall does not exist on 64 bit kernels.

The reason we are making the syscall directly is because of old glibc's which don't do any conversion.

So we now do a conversion unconditionally and call fcntl64 if the kernel is 32-bit.

+1.

Quoted 2 lines

When we no longer support old glibcs we can drop this compat function altogether.

I wonder which glibc these are. And how about musl?

Anyway, thanks!

Few unimportant notes below.
...

Quoted 11 lines

+++ b/testcases/kernel/syscalls/fcntl/fcntl_common.h

testcases/kernel/syscalls/fcntl/fcntl_common.h +5 -0
@@ -1,38 +1,71 @@
 #ifndef FCNTL_COMMON_H__
 #define FCNTL_COMMON_H__
 
+#include <inttypes.h>
+
+#include "tst_test.h"
+#include "tst_kernel.h"
+
 #include "lapi/syscalls.h"

testcases/kernel/syscalls/fcntl/fcntl_common.h line 19

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +9 -0
 #include "lapi/abisize.h"
+#include "lapi/fcntl.h"
+
+struct my_flock64 {
+	int16_t l_type;
+	int16_t l_whence;
+	int64_t l_start;
+	int64_t l_len;
+	int32_t l_pid;
+#if defined(__sparc__)

nit: #ifdef __sparc__

Well, we still support 32bit sparc (you did support for atomic in include/tst_atomic.h), but IMHO it's dead (I might ask if John Paul Adrian Glaubitz knows about anybody using LTP for testing on sparc). But as this is in kernel struct, there is no harm to keep it for LTP as well.

Quoted 3 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +3 -0
+	int16_t padding;
+#endif
+};

...

Quoted 18 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +14 -3
+static inline int fcntl_compat(const char *file, const int line, const char *cmd_name,
+			       int fd, int cmd, struct flock *lck)
 {
-	int ret = tst_syscall(__NR_fcntl64, fd, cmd, lck);
-	if (ret == -1)
-		tst_brk(TBROK|TERRNO, "fcntl64");
+	struct my_flock64 l64 = {
+		.l_type = lck->l_type,
+		.l_whence = lck->l_whence,
+		.l_start = lck->l_start,
+		.l_len = lck->l_len,
+		.l_pid = lck->l_pid,
+	};
+	const long sysno = tst_kernel_bits() > 32 ? __NR_fcntl : __NR_fcntl64;
+	const int ret = tst_syscall(sysno, fd, cmd, &l64);
+
+	lck->l_type = l64.l_type;
+	lck->l_whence = l64.l_whence;

testcases/kernel/syscalls/fcntl/fcntl_common.h line 60

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +10 -0
+	lck->l_start = l64.l_start;
+	lck->l_len = l64.l_len;
+	lck->l_pid = l64.l_pid;
+
+	if (ret != -1)
+		return ret;
+
+	tst_brk_(file, line, TBROK | TERRNO,
+		 "%s(%d, %s, { %d, %d, %"PRId64", %"PRId64", %d })",
+		 tst_kernel_bits() > 32 ? "fcntl" : "fcntl64",

nit: maybe cache tst_kernel_bits() to variable?

Kind regards,
Petr

Quoted 12 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +7 -1
+		 fd,
+		 cmd_name,
+		 l64.l_type, l64.l_whence, l64.l_start, l64.l_len, l64.l_pid);
+
 	return ret;
 }
-#endif
+
+#define FCNTL_COMPAT(fd, cmd, flock) \
+	fcntl_compat(__FILE__, __LINE__, #cmd, fd, cmd, flock)
 
 #endif /* FCNTL_COMMON_H__ */
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Re: [LTP] [PATCH 2/2] fcntl{34, 36}: Always use 64-bit flock struct to avoid EINVAL

Hello,

Quoted 8 lines · Petr Vorel

Hi Richie,

[ Cc Khem Raj ]

Quoted 3 lines

Recently we switched to using struct fcntl with _FILE_OFFSET_BITS instead of the transitional type fcntl64 which has been removed from some libcs.

Quoted 7 lines

Do you mean b0320456cd ("testcases: Fix largefile support") ? Because this commit really broke both 32 bit emulation
+ (obviously) LTP on native 32bit.

Please add before merge:

Fixes b0320456c ("testcases: Fix largefile support")

I suppose, thanks. I'm not sure how much fixes tags help in LTP? In kernel they are used in automatic backporting and such.

Quoted 10 lines

(although this needs also previous fix)

Quoted 6 lines

This broke testing with 32-bit executables on a 64bit kernel when FILE_OFFSET_BITS was not set to 64. Because the fcntl64 syscall does not exist on 64 bit kernels.

The reason we are making the syscall directly is because of old glibc's which don't do any conversion.

Quoted 7 lines
Quoted 2 lines

So we now do a conversion unconditionally and call fcntl64 if the kernel is 32-bit.

+1.

Quoted 2 lines

When we no longer support old glibcs we can drop this compat function altogether.

I wonder which glibc these are. And how about musl?

I find it difficult to tell honestly. Pre 2.28 perhaps which is just what "git describe --contains" suggests.

Muslc appears to always use 64-bit fcntl.

Quoted 5 lines

Anyway, thanks!

Will merge, thanks!

Quoted 27 lines

Few unimportant notes below.
...

Quoted 11 lines

+++ b/testcases/kernel/syscalls/fcntl/fcntl_common.h

testcases/kernel/syscalls/fcntl/fcntl_common.h +5 -0
@@ -1,38 +1,71 @@
 #ifndef FCNTL_COMMON_H__
 #define FCNTL_COMMON_H__
 
+#include <inttypes.h>
+
+#include "tst_test.h"
+#include "tst_kernel.h"
+
 #include "lapi/syscalls.h"

testcases/kernel/syscalls/fcntl/fcntl_common.h line 19

Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +9 -0
 #include "lapi/abisize.h"
+#include "lapi/fcntl.h"
+
+struct my_flock64 {
+	int16_t l_type;
+	int16_t l_whence;
+	int64_t l_start;
+	int64_t l_len;
+	int32_t l_pid;
+#if defined(__sparc__)

nit: #ifdef __sparc__

Quoted 4 lines

Well, we still support 32bit sparc (you did support for atomic in include/tst_atomic.h), but IMHO it's dead (I might ask if John Paul Adrian Glaubitz knows about anybody using LTP for testing on sparc). But as this is in kernel struct, there is no harm to keep it for LTP as well.

Yes, my main thinking was that it is easy to include and I'm not sure if __sparc__ also gets set on sparc64 or whatever is actually in use.

Quoted 28 lines
Quoted 4 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +3 -0
+	int16_t padding;
+#endif
+};

...

Quoted 21 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +17 -3
+static inline int fcntl_compat(const char *file, const int line, const char *cmd_name,
+			       int fd, int cmd, struct flock *lck)
 {
-	int ret = tst_syscall(__NR_fcntl64, fd, cmd, lck);
-	if (ret == -1)
-		tst_brk(TBROK|TERRNO, "fcntl64");
+	struct my_flock64 l64 = {
+		.l_type = lck->l_type,
+		.l_whence = lck->l_whence,
+		.l_start = lck->l_start,
+		.l_len = lck->l_len,
+		.l_pid = lck->l_pid,
+	};
+	const long sysno = tst_kernel_bits() > 32 ? __NR_fcntl : __NR_fcntl64;
+	const int ret = tst_syscall(sysno, fd, cmd, &l64);
+
+	lck->l_type = l64.l_type;
+	lck->l_whence = l64.l_whence;
+	lck->l_start = l64.l_start;
+	lck->l_len = l64.l_len;
+	lck->l_pid = l64.l_pid;
Quoted 8 lines

testcases/kernel/syscalls/fcntl/fcntl_common.h line 60

Quoted 7 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +7 -0
+
+	if (ret != -1)
+		return ret;
+
+	tst_brk_(file, line, TBROK | TERRNO,
+		 "%s(%d, %s, { %d, %d, %"PRId64", %"PRId64", %d })",
+		 tst_kernel_bits() > 32 ? "fcntl" : "fcntl64",

nit: maybe cache tst_kernel_bits() to variable?

The function already does it.

Quoted 16 lines

Kind regards,
Petr

Quoted 12 lines
testcases/kernel/syscalls/fcntl/fcntl_common.h +7 -1
+		 fd,
+		 cmd_name,
+		 l64.l_type, l64.l_whence, l64.l_start, l64.l_len, l64.l_pid);
+
 	return ret;
 }
-#endif
+
+#define FCNTL_COMPAT(fd, cmd, flock) \
+	fcntl_compat(__FILE__, __LINE__, #cmd, fd, cmd, flock)
 
 #endif /* FCNTL_COMMON_H__ */
Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
In reply to Richard Palethorpe via ltp

Hi Richie,

Quoted 10 lines
---
 include/lapi/syscalls/regen.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/lapi/syscalls/regen.sh +0 -0
index 97027e2f3..217595f34 100755

include/lapi/syscalls/regen.sh cat << EOF > "${output_pid}" · line 41

Quoted 5 lines
include/lapi/syscalls/regen.sh +1 -1
@@ -38,12 +38,12 @@ cat << EOF > "${output_pid}"
 #ifdef TST_TEST_H__
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
 	tst_brk(TCONF, \\
-		"syscall(%d) " SNR " not supported on your arch", NR); \\
+		"syscall(%ld) " SNR " not supported on your arch", NR); \\

Looks like quite old change:

36283230cb ("linux_syscall_numbers: add syscall number to output")

include/lapi/syscalls/regen.sh cat << EOF > "${output_pid}" · line 48

Quoted 8 lines
include/lapi/syscalls/regen.sh +1 -1
 })
 #else
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
 	tst_brkm(TCONF, CLEANUP, \\
-		"syscall(%d) " SNR " not supported on your arch", NR); \\
+		"syscall(%ld) " SNR " not supported on your arch", NR); \\
 })
 #endif

I expected this would fix several warnings, but it generated several warnings on both x86_64 and i686 due tst_syscall() being used on many places. To show just few:

$ make autotools && ./configure && cd lib/newlib_tests && rm -f tst_expiration_timer && make tst_expiration_timer
In file included from tst_expiration_timer.c:11:
../../include/tst_timer.h: In function ‘sys_clock_getres’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:204:16: note: in expansion of macro ‘tst_syscall’
  204 |         return tst_syscall(__NR_clock_getres, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_getres64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:209:16: note: in expansion of macro ‘tst_syscall’
  209 |         return tst_syscall(__NR_clock_getres_time64, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_gettime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:219:16: note: in expansion of macro ‘tst_syscall’
  219 |         return tst_syscall(__NR_clock_gettime, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_gettime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:224:16: note: in expansion of macro ‘tst_syscall’
  224 |         return tst_syscall(__NR_clock_gettime64, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_settime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:234:16: note: in expansion of macro ‘tst_syscall’
  234 |         return tst_syscall(__NR_clock_settime, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_settime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:239:16: note: in expansion of macro ‘tst_syscall’
  239 |         return tst_syscall(__NR_clock_settime64, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_nanosleep’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:251:16: note: in expansion of macro ‘tst_syscall’
  251 |         return tst_syscall(__NR_clock_nanosleep, clk_id, flags,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_nanosleep64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:258:16: note: in expansion of macro ‘tst_syscall’
  258 |         return tst_syscall(__NR_clock_nanosleep_time64, clk_id, flags,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_futex’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:265:16: note: in expansion of macro ‘tst_syscall’
  265 |         return tst_syscall(__NR_futex, uaddr, futex_op, val, to, uaddr2, val3);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_futex_time64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:271:16: note: in expansion of macro ‘tst_syscall’
  271 |         return tst_syscall(__NR_futex_time64, uaddr, futex_op, val, to, uaddr2, val3);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedsend’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:283:16: note: in expansion of macro ‘tst_syscall’
  283 |         return tst_syscall(__NR_mq_timedsend, mqdes, msg_ptr, msg_len, msg_prio,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedsend64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:290:16: note: in expansion of macro ‘tst_syscall’
  290 |         return tst_syscall(__NR_mq_timedsend_time64, mqdes, msg_ptr, msg_len,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedreceive’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:303:16: note: in expansion of macro ‘tst_syscall’
  303 |         return tst_syscall(__NR_mq_timedreceive, mqdes, msg_ptr, msg_len,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedreceive64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:310:16: note: in expansion of macro ‘tst_syscall’
  310 |         return tst_syscall(__NR_mq_timedreceive_time64, mqdes, msg_ptr, msg_len,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_sched_rr_get_interval’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:321:16: note: in expansion of macro ‘tst_syscall’
  321 |         return tst_syscall(__NR_sched_rr_get_interval, pid, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_sched_rr_get_interval64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:326:16: note: in expansion of macro ‘tst_syscall’
  326 |         return tst_syscall(__NR_sched_rr_get_interval_time64, pid, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_gettime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:331:16: note: in expansion of macro ‘tst_syscall’
  331 |         return tst_syscall(__NR_timer_gettime, timerid, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_gettime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:336:16: note: in expansion of macro ‘tst_syscall’
  336 |         return tst_syscall(__NR_timer_gettime64, timerid, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_settime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:342:16: note: in expansion of macro ‘tst_syscall’
  342 |         return tst_syscall(__NR_timer_settime, timerid, flags, its, old_its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_settime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:348:16: note: in expansion of macro ‘tst_syscall’
  348 |         return tst_syscall(__NR_timer_settime64, timerid, flags, its, old_its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_gettime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:353:16: note: in expansion of macro ‘tst_syscall’
  353 |         return tst_syscall(__NR_timerfd_gettime, fd, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_gettime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:358:16: note: in expansion of macro ‘tst_syscall’
  358 |         return tst_syscall(__NR_timerfd_gettime64, fd, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_settime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:364:16: note: in expansion of macro ‘tst_syscall’
  364 |         return tst_syscall(__NR_timerfd_settime, fd, flags, its, old_its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_settime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:370:16: note: in expansion of macro ‘tst_syscall’
  370 |         return tst_syscall(__NR_timerfd_settime64, fd, flags, its, old_its);
      |                ^~~~~~~~~~~
CC lib/newlib_tests/tst_expiration_timer
$ cd ../../testcases/kernel/syscalls/clone && rm -f clone09 && make clone09

../../../../include/lapi/sched.h: In function ‘clone3’:
../../../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
81 | tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
../../../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’

   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../../../include/lapi/sched.h:61:16: note: in expansion of macro ‘tst_syscall’
   61 |         return tst_syscall(__NR_clone3, args, size);
      |                ^~~~~~~~~~~

../../../../include/lapi/sched.h: In function ‘clone3_supported_by_kernel’:
../../../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
81 | tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
../../../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’

   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../../../include/lapi/sched.h:69:17: note: in expansion of macro ‘tst_syscall’
   69 |                 tst_syscall(__NR_clone3, NULL, 0);
      |                 ^~~~~~~~~~~

clone09.c: In function ‘newnet’:
../../../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
81 | tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
../../../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’

   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~

clone09.c:38:9: note: in expansion of macro ‘tst_syscall’
38 | tst_syscall(__NR_exit, 0);

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

Hello,

Quoted 22 lines · Petr Vorel

Hi Richie,

Quoted 10 lines
---
 include/lapi/syscalls/regen.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/lapi/syscalls/regen.sh +0 -0
index 97027e2f3..217595f34 100755

include/lapi/syscalls/regen.sh cat << EOF > "${output_pid}" · line 41

Quoted 5 lines
include/lapi/syscalls/regen.sh +1 -1
@@ -38,12 +38,12 @@ cat << EOF > "${output_pid}"
 #ifdef TST_TEST_H__
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
 	tst_brk(TCONF, \\
-		"syscall(%d) " SNR " not supported on your arch", NR); \\
+		"syscall(%ld) " SNR " not supported on your arch", NR); \\

Looks like quite old change:

36283230cb ("linux_syscall_numbers: add syscall number to output")

Quoted 12 lines

include/lapi/syscalls/regen.sh cat << EOF > "${output_pid}" · line 48

Quoted 8 lines
include/lapi/syscalls/regen.sh +1 -1
 })
 #else
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
 	tst_brkm(TCONF, CLEANUP, \\
-		"syscall(%d) " SNR " not supported on your arch", NR); \\
+		"syscall(%ld) " SNR " not supported on your arch", NR); \\
 })
 #endif

I expected this would fix several warnings, but it generated several warnings on both x86_64 and i686 due tst_syscall() being used on many places. To show just few:

Ah, OK, let's forget about it for now. I'll just change the syscall number to int in fcntl_compat.

Possibly we would have to fix this to support x32.

Quoted 362 lines
$ make autotools && ./configure && cd lib/newlib_tests && rm -f tst_expiration_timer && make tst_expiration_timer
In file included from tst_expiration_timer.c:11:
../../include/tst_timer.h: In function ‘sys_clock_getres’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:204:16: note: in expansion of macro ‘tst_syscall’
  204 |         return tst_syscall(__NR_clock_getres, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_getres64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:209:16: note: in expansion of macro ‘tst_syscall’
  209 |         return tst_syscall(__NR_clock_getres_time64, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_gettime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:219:16: note: in expansion of macro ‘tst_syscall’
  219 |         return tst_syscall(__NR_clock_gettime, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_gettime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:224:16: note: in expansion of macro ‘tst_syscall’
  224 |         return tst_syscall(__NR_clock_gettime64, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_settime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:234:16: note: in expansion of macro ‘tst_syscall’
  234 |         return tst_syscall(__NR_clock_settime, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_settime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:239:16: note: in expansion of macro ‘tst_syscall’
  239 |         return tst_syscall(__NR_clock_settime64, clk_id, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_nanosleep’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:251:16: note: in expansion of macro ‘tst_syscall’
  251 |         return tst_syscall(__NR_clock_nanosleep, clk_id, flags,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_clock_nanosleep64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:258:16: note: in expansion of macro ‘tst_syscall’
  258 |         return tst_syscall(__NR_clock_nanosleep_time64, clk_id, flags,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_futex’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:265:16: note: in expansion of macro ‘tst_syscall’
  265 |         return tst_syscall(__NR_futex, uaddr, futex_op, val, to, uaddr2, val3);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_futex_time64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:271:16: note: in expansion of macro ‘tst_syscall’
  271 |         return tst_syscall(__NR_futex_time64, uaddr, futex_op, val, to, uaddr2, val3);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedsend’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:283:16: note: in expansion of macro ‘tst_syscall’
  283 |         return tst_syscall(__NR_mq_timedsend, mqdes, msg_ptr, msg_len, msg_prio,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedsend64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:290:16: note: in expansion of macro ‘tst_syscall’
  290 |         return tst_syscall(__NR_mq_timedsend_time64, mqdes, msg_ptr, msg_len,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedreceive’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:303:16: note: in expansion of macro ‘tst_syscall’
  303 |         return tst_syscall(__NR_mq_timedreceive, mqdes, msg_ptr, msg_len,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_mq_timedreceive64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:310:16: note: in expansion of macro ‘tst_syscall’
  310 |         return tst_syscall(__NR_mq_timedreceive_time64, mqdes, msg_ptr, msg_len,
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_sched_rr_get_interval’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:321:16: note: in expansion of macro ‘tst_syscall’
  321 |         return tst_syscall(__NR_sched_rr_get_interval, pid, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_sched_rr_get_interval64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:326:16: note: in expansion of macro ‘tst_syscall’
  326 |         return tst_syscall(__NR_sched_rr_get_interval_time64, pid, ts);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_gettime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:331:16: note: in expansion of macro ‘tst_syscall’
  331 |         return tst_syscall(__NR_timer_gettime, timerid, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_gettime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:336:16: note: in expansion of macro ‘tst_syscall’
  336 |         return tst_syscall(__NR_timer_gettime64, timerid, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_settime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:342:16: note: in expansion of macro ‘tst_syscall’
  342 |         return tst_syscall(__NR_timer_settime, timerid, flags, its, old_its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timer_settime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:348:16: note: in expansion of macro ‘tst_syscall’
  348 |         return tst_syscall(__NR_timer_settime64, timerid, flags, its, old_its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_gettime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:353:16: note: in expansion of macro ‘tst_syscall’
  353 |         return tst_syscall(__NR_timerfd_gettime, fd, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_gettime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:358:16: note: in expansion of macro ‘tst_syscall’
  358 |         return tst_syscall(__NR_timerfd_gettime64, fd, its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_settime’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:364:16: note: in expansion of macro ‘tst_syscall’
  364 |         return tst_syscall(__NR_timerfd_settime, fd, flags, its, old_its);
      |                ^~~~~~~~~~~
../../include/tst_timer.h: In function ‘sys_timerfd_settime64’:
../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
   81 |                 tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                       ^~~~~~~~~
../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’
   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../include/tst_timer.h:370:16: note: in expansion of macro ‘tst_syscall’
  370 |         return tst_syscall(__NR_timerfd_settime64, fd, flags, its, old_its);
      |                ^~~~~~~~~~~
CC lib/newlib_tests/tst_expiration_timer
$ cd ../../testcases/kernel/syscalls/clone && rm -f clone09 && make clone09

../../../../include/lapi/sched.h: In function ‘clone3’:
../../../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
81 | tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
../../../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’

   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../../../include/lapi/sched.h:61:16: note: in expansion of macro ‘tst_syscall’
   61 |         return tst_syscall(__NR_clone3, args, size);
      |                ^~~~~~~~~~~

../../../../include/lapi/sched.h: In function ‘clone3_supported_by_kernel’:
../../../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
81 | tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
../../../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’

   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~
../../../../include/lapi/sched.h:69:17: note: in expansion of macro ‘tst_syscall’
   69 |                 tst_syscall(__NR_clone3, NULL, 0);
      |                 ^~~~~~~~~~~

clone09.c: In function ‘newnet’:
../../../../include/tst_test.h:81:55: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int’ [-Wformat=]
81 | tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
../../../../include/lapi/syscalls.h:23:9: note: in expansion of macro ‘tst_brk’

   23 |         tst_brk(TCONF, \
      |         ^~~~~~~
../../../../include/lapi/syscalls.h:42:17: note: in expansion of macro ‘TST_SYSCALL_BRK__’
   42 |                 TST_SYSCALL_BRK__(NR, #NR); \
      |                 ^~~~~~~~~~~~~~~~~

clone09.c:38:9: note: in expansion of macro ‘tst_syscall’
38 | tst_syscall(__NR_exit, 0);

Kind regards,
Petr

Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp