getgroups01_16 and getgroups03_16 did not use 16-bit
versions of getgroups() syscall. Fixed this in the same manner like
syscalls/setgroups.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmansk...@oracle.com>
---
 testcases/kernel/syscalls/getgroups/getgroups01.c |   22 +++++++++++---------
 testcases/kernel/syscalls/getgroups/getgroups03.c |   17 ++++++++-------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/testcases/kernel/syscalls/getgroups/getgroups01.c 
b/testcases/kernel/syscalls/getgroups/getgroups01.c
index 1d58109..f319ebf 100644
--- a/testcases/kernel/syscalls/getgroups/getgroups01.c
+++ b/testcases/kernel/syscalls/getgroups/getgroups01.c
@@ -52,8 +52,10 @@
 #include <grp.h>
 #include <sys/param.h>
 #include <sys/types.h>
+
 #include "test.h"
 #include "usctest.h"
+#include "compat_16.h"
 
 static void setup(void);
 static void cleanup(void);
@@ -61,14 +63,14 @@ static void cleanup(void);
 char *TCID = "getgroups01";
 int TST_TOTAL = 4;
 
-static gid_t gidset[NGROUPS];
-static gid_t cmpset[NGROUPS];
+static GID_T gidset[NGROUPS];
+static GID_T cmpset[NGROUPS];
 
 int main(int ac, char **av)
 {
        int lc;
        char *msg;
-       gid_t group;
+       GID_T group;
        int i;
        int entries;
 
@@ -83,7 +85,7 @@ int main(int ac, char **av)
 
                tst_count = 0;
 
-               TEST(getgroups(-1, gidset));
+               TEST(GETGROUPS(cleanup, -1, gidset));
 
                if (TEST_RETURN == 0) {
                        tst_resm(TFAIL, "getgroups succeeded unexpectedly");
@@ -101,14 +103,14 @@ int main(int ac, char **av)
                 * return and the the gidset array is not modified.
                 * This is a POSIX special case.
                 */
-               memset(gidset, 052, NGROUPS * sizeof(gid_t));
-               memset(cmpset, 052, NGROUPS * sizeof(gid_t));
+               memset(gidset, 052, NGROUPS * sizeof(GID_T));
+               memset(cmpset, 052, NGROUPS * sizeof(GID_T));
 
-               TEST(getgroups(0, gidset));
+               TEST(GETGROUPS(cleanup, 0, gidset));
                if (TEST_RETURN == -1) {
                        tst_resm(TFAIL | TTERRNO, "getgroups failed 
unexpectedly");
                } else if (STD_FUNCTIONAL_TEST) {
-                       if (memcmp(cmpset, gidset, NGROUPS * sizeof(gid_t)) != 
0)
+                       if (memcmp(cmpset, gidset, NGROUPS * sizeof(GID_T)) != 
0)
                                tst_resm(TFAIL,
                                         "getgroups modified the gidset array");
                        else
@@ -126,7 +128,7 @@ int main(int ac, char **av)
                                 "getgroups returned %ld; unable to test that 
using ngrps >=1 but less than number of grps",
                                 TEST_RETURN);
                } else {
-                       TEST(getgroups(TEST_RETURN - 1, gidset));
+                       TEST(GETGROUPS(cleanup, TEST_RETURN - 1, gidset));
                        if (TEST_RETURN == -1) {
                                if (STD_FUNCTIONAL_TEST) {
                                        if (errno == EINVAL)
@@ -145,7 +147,7 @@ int main(int ac, char **av)
                        }
                }
 
-               TEST(getgroups(NGROUPS, gidset));
+               TEST(GETGROUPS(cleanup, NGROUPS, gidset));
                if ((entries = TEST_RETURN) == -1) {
                        tst_resm(TFAIL | TTERRNO,
                                 "getgroups failed unexpectedly");
diff --git a/testcases/kernel/syscalls/getgroups/getgroups03.c 
b/testcases/kernel/syscalls/getgroups/getgroups03.c
index 1e25756..5e46792 100644
--- a/testcases/kernel/syscalls/getgroups/getgroups03.c
+++ b/testcases/kernel/syscalls/getgroups/getgroups03.c
@@ -41,6 +41,7 @@
 
 #include "test.h"
 #include "usctest.h"
+#include "compat_16.h"
 
 #define TESTUSER "root"
 
@@ -48,8 +49,8 @@ char *TCID = "getgroups03";
 int TST_TOTAL = 1;
 
 static int ngroups;
-static gid_t groups_list[NGROUPS];
-static gid_t groups[NGROUPS];
+static GID_T groups_list[NGROUPS];
+static GID_T groups[NGROUPS];
 
 static void verify_groups(int ret_ngroups);
 static void setup(void);
@@ -70,7 +71,7 @@ int main(int ac, char **av)
 
                tst_count = 0;
 
-               TEST(getgroups(gidsetsize, groups_list));
+               TEST(GETGROUPS(cleanup, gidsetsize, groups_list));
 
                if (TEST_RETURN == -1) {
                        tst_resm(TFAIL | TTERRNO, "getgroups failed");
@@ -88,18 +89,18 @@ int main(int ac, char **av)
 }
 
 /*
- * readgroups(gid_t *)  - Read supplimentary group ids of "root" user
+ * readgroups(GID_T *)  - Read supplimentary group ids of "root" user
  * Scans the /etc/group file to get IDs of all the groups to which TESTUSER
  * belongs and puts them into the array passed.
  * Returns the no of gids read.
  */
-static int readgroups(gid_t groups[NGROUPS])
+static int readgroups(GID_T groups[NGROUPS])
 {
        struct group *grp;
        int ngrps = 0;
        int i;
        int found;
-       gid_t g;
+       GID_T g;
 
        setgrent();
 
@@ -151,7 +152,7 @@ static void setup(void)
         * testcase will fail. So execute setgroups() before executing
         * getgroups()
         */
-       if (setgroups(ngroups, groups) == -1)
+       if (SETGROUPS(cleanup, ngroups, groups) == -1)
                tst_brkm(TBROK | TERRNO, cleanup, "setgroups failed");
 }
 
@@ -165,7 +166,7 @@ static void setup(void)
 static void verify_groups(int ret_ngroups)
 {
        int i, j;
-       gid_t egid;
+       GID_T egid;
        int egid_flag = 1;
        int fflag = 1;
 
-- 
1.7.1


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to