[LTP] [PATCH V2 1/2] syscalls/setgroups: fix 16-bit versions of the testcases

Stanislav Kholmanskikh
2013-08-27T09:35:46Z

Now 16-bit testcases are executed only if platform
has corresponding 16-bit version of setgroups() syscall.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
testcases/kernel/syscalls/setgroups/compat_16.h | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/setgroups/compat_16.h b/testcases/kernel/syscalls/setgroups/compat_16.h
index 0de4e78..8f46da9 100644
--- a/testcases/kernel/syscalls/setgroups/compat_16.h
+++ b/testcases/kernel/syscalls/setgroups/compat_16.h
@@ -32,9 +32,16 @@ extern void cleanup(void);
#ifdef TST_USE_COMPAT16_SYSCALL

long
-SETGROUPS(size_t gidsetsize, GID_T *list)
+SETGROUPS(size_t gidsetsize, GID_T *list16)
{
- return ltp_syscall(__NR_setgroups, gidsetsize, list);
+# if (__NR_setgroups32 != __LTP__NR_INVALID_SYSCALL)
+ /* __NR_setgroups - 16-bit version of setgroups() syscall */
+ return ltp_syscall(__NR_setgroups, gidsetsize, list16);
+# else
+ /* The platform has no 16-bit version of setgroups() syscall */
+ tst_brkm(TCONF, NULL,
+ "16-bit version of setgroups() is not supported on your arch");
+# endif /* __NR_setgroups32 */
}

int
--
1.7.1

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!