return NULL;
}
+static void *uwrap_getgid(void *arg)
+{
+ gid_t g;
+ (void) arg; /* unused */
+
+ g = getgid();
+ assert_int_equal(g, 1999);
+
+ return NULL;
+}
+
static void test_sync_setgid(void **state)
{
pthread_attr_t pthread_custom_attr;
pthread_t threads[NUM_THREADS];
gid_t g;
int i;
+ int rc;
(void) state; /* unused */
g = getgid();
assert_int_equal(g, 999);
+ rc = setgid(1999);
+ assert_int_equal(rc, 0);
+
+ pthread_create(&threads[0],
+ &pthread_custom_attr,
+ uwrap_getgid,
+ NULL);
+
+ pthread_join(threads[0], NULL);
+
+ g = getgid();
+ assert_int_equal(g, 1999);
+
pthread_attr_destroy(&pthread_custom_attr);
}