unshare03: use sizeof(long long) to fix for 32bit
PATCH 1/1 unshare03: use sizeof(long long) to fix for 32bit
when executing on 32bit compat layer
"nr_open = sizeof(long) * 8" does not evaluate to a large enough value for /proc/sys/fs/nr_open.
unshare03.c:38: TBROK: Failed to close FILE '/proc/sys/fs/nr_open': EINVAL (22) Use (long long) instead.
--- testcases/kernel/syscalls/unshare/unshare03.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/unshare/unshare03.c +1 -1
@@ -27,7 +27,7 @@ static void run(void) .exit_signal = SIGCHLD, }; -int nr_open =sizeof (long ) *8 ; +int nr_open =sizeof (long long ) *8 ;SAFE_DUP2 (2 , nr_open +1 );
Signature · 5 lines
2.43.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Avinesh,
Quoted 18 lines
when executing on 32bit compat layer
"nr_open= sizeof(long) * 8" does not evaluate to a large enough value for/proc/sys/fs/nr_open.
unshare03.c:38: TBROK: Failed to close FILE '/proc/sys/fs/nr_open': EINVAL (22) Use (long long) instead.Fixes fc8be6ed4 ("unshare03: Simplify EMFILE test by using fixed fd limit (sizeof(long) * 8)")Suggested-by Petr Vorel <[email protected]>Signed-off-by Avinesh Kumar <[email protected]>--- testcases/kernel/syscalls/unshare/unshare03.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/kernel/syscalls/unshare/unshare03.c +0
-0
testcases/kernel/syscalls/unshare/unshare03.c static void run(void) · line 30
Quoted 5 lines
testcases/kernel/syscalls/unshare/unshare03.c +1
-1@@ -27,7 +27,7 @@ static void run(void) .exit_signal = SIGCHLD, }; -int nr_open =sizeof (long ) *8 ; +int nr_open =sizeof (long long ) *8 ;
Thank you!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Avinesh, all,
merged, thank you!
Quoted 25 lines
when executing on 32bit compat layer
"nr_open= sizeof(long) * 8" does not evaluate to a large enough value for/proc/sys/fs/nr_open.
unshare03.c:38: TBROK: Failed to close FILE '/proc/sys/fs/nr_open': EINVAL (22) Use (long long) instead.Fixes fc8be6ed4 ("unshare03: Simplify EMFILE test by using fixed fd limit (sizeof(long) * 8)")Suggested-by Petr Vorel <[email protected]>Signed-off-by Avinesh Kumar <[email protected]>--- testcases/kernel/syscalls/unshare/unshare03.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/kernel/syscalls/unshare/unshare03.c +1
-1@@ -27,7 +27,7 @@ static void run(void) .exit_signal = SIGCHLD, }; -int nr_open =sizeof (long ) *8 ; +int nr_open =sizeof (long long ) *8 ;SAFE_DUP2 (2 , nr_open +1 );
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp