Lines Matching full:if

29 	if (fd < 0)  in touch_anon()
35 if (ret < 0) { in touch_anon()
36 if (errno != EINTR) { in touch_anon()
58 if (buf == MAP_FAILED) in alloc_and_touch_anon_noexit()
61 if (touch_anon((char *)buf, size)) { in alloc_and_touch_anon_noexit()
89 if (!cg_test) in test_cgcore_destroy()
93 if (cg_create(cg_test)) in test_cgcore_destroy()
99 if (child_pid < 0) in test_cgcore_destroy()
103 if (cg_wait_for_proc_count(cg_test, 1)) in test_cgcore_destroy()
106 if (cg_killall(cg_test)) in test_cgcore_destroy()
111 if (cg_read(cg_test, "cgroup.procs", buf, sizeof(buf))) in test_cgcore_destroy()
113 if (buf[0] == '\0') in test_cgcore_destroy()
118 if (rmdir(cg_test)) in test_cgcore_destroy()
121 if (waitpid(child_pid, NULL, 0) < 0) in test_cgcore_destroy()
126 if (cg_test) in test_cgcore_destroy()
156 if (!cg_test_a || !cg_test_b || !cg_test_c || !cg_test_d) in test_cgcore_populated()
159 if (cg_create(cg_test_a)) in test_cgcore_populated()
162 if (cg_create(cg_test_b)) in test_cgcore_populated()
165 if (cg_create(cg_test_c)) in test_cgcore_populated()
168 if (cg_create(cg_test_d)) in test_cgcore_populated()
171 if (cg_enter_current(cg_test_c)) in test_cgcore_populated()
174 if (cg_read_strcmp(cg_test_a, "cgroup.events", "populated 1\n")) in test_cgcore_populated()
177 if (cg_read_strcmp(cg_test_b, "cgroup.events", "populated 1\n")) in test_cgcore_populated()
180 if (cg_read_strcmp(cg_test_c, "cgroup.events", "populated 1\n")) in test_cgcore_populated()
183 if (cg_read_strcmp(cg_test_d, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
186 if (cg_enter_current(root)) in test_cgcore_populated()
189 if (cg_read_strcmp(cg_test_a, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
192 if (cg_read_strcmp(cg_test_b, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
195 if (cg_read_strcmp(cg_test_c, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
198 if (cg_read_strcmp(cg_test_d, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
203 if (cgroup_fd < 0) in test_cgcore_populated()
207 if (pid < 0) { in test_cgcore_populated()
208 if (errno == ENOSYS) in test_cgcore_populated()
213 if (pid == 0) { in test_cgcore_populated()
214 if (raise(SIGSTOP)) in test_cgcore_populated()
225 if (err) in test_cgcore_populated()
228 if (cg_read_strcmp(cg_test_d, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
232 if (cg_test_d) { in test_cgcore_populated()
239 if (pid < 0) in test_cgcore_populated()
241 if (pid == 0) in test_cgcore_populated()
250 if (cg_test_d) in test_cgcore_populated()
252 if (cg_test_c) in test_cgcore_populated()
254 if (cg_test_b) in test_cgcore_populated()
256 if (cg_test_a) in test_cgcore_populated()
262 if (cgroup_fd >= 0) in test_cgcore_populated()
283 if (!parent || !child || !grandparent) in test_cgcore_invalid_domain()
286 if (cg_create(grandparent)) in test_cgcore_invalid_domain()
289 if (cg_create(parent)) in test_cgcore_invalid_domain()
292 if (cg_create(child)) in test_cgcore_invalid_domain()
295 if (cg_write(parent, "cgroup.type", "threaded")) in test_cgcore_invalid_domain()
298 if (cg_read_strcmp(child, "cgroup.type", "domain invalid\n")) in test_cgcore_invalid_domain()
301 if (!cg_enter_current(child)) in test_cgcore_invalid_domain()
304 if (errno != EOPNOTSUPP) in test_cgcore_invalid_domain()
307 if (!clone_into_cgroup_run_wait(child)) in test_cgcore_invalid_domain()
310 if (errno == ENOSYS) in test_cgcore_invalid_domain()
313 if (errno != EOPNOTSUPP) in test_cgcore_invalid_domain()
321 if (child) in test_cgcore_invalid_domain()
323 if (parent) in test_cgcore_invalid_domain()
325 if (grandparent) in test_cgcore_invalid_domain()
344 if (!parent || !child) in test_cgcore_parent_becomes_threaded()
347 if (cg_create(parent)) in test_cgcore_parent_becomes_threaded()
350 if (cg_create(child)) in test_cgcore_parent_becomes_threaded()
353 if (cg_write(child, "cgroup.type", "threaded")) in test_cgcore_parent_becomes_threaded()
356 if (cg_read_strcmp(parent, "cgroup.type", "domain threaded\n")) in test_cgcore_parent_becomes_threaded()
362 if (child) in test_cgcore_parent_becomes_threaded()
364 if (parent) in test_cgcore_parent_becomes_threaded()
381 if (cg_read_strstr(root, "cgroup.controllers", "cpu") || in test_cgcore_no_internal_process_constraint_on_threads()
389 if (!parent || !child) in test_cgcore_no_internal_process_constraint_on_threads()
392 if (cg_create(parent)) in test_cgcore_no_internal_process_constraint_on_threads()
395 if (cg_create(child)) in test_cgcore_no_internal_process_constraint_on_threads()
398 if (cg_write(parent, "cgroup.type", "threaded")) in test_cgcore_no_internal_process_constraint_on_threads()
401 if (cg_write(child, "cgroup.type", "threaded")) in test_cgcore_no_internal_process_constraint_on_threads()
404 if (cg_write(parent, "cgroup.subtree_control", "+cpu")) in test_cgcore_no_internal_process_constraint_on_threads()
407 if (cg_enter_current(parent)) in test_cgcore_no_internal_process_constraint_on_threads()
415 if (child) in test_cgcore_no_internal_process_constraint_on_threads()
417 if (parent) in test_cgcore_no_internal_process_constraint_on_threads()
425 * Test that you can't enable a controller on a child if it's not enabled
435 if (!parent || !child) in test_cgcore_top_down_constraint_enable()
438 if (cg_create(parent)) in test_cgcore_top_down_constraint_enable()
441 if (cg_create(child)) in test_cgcore_top_down_constraint_enable()
444 if (!cg_write(child, "cgroup.subtree_control", "+memory")) in test_cgcore_top_down_constraint_enable()
450 if (child) in test_cgcore_top_down_constraint_enable()
452 if (parent) in test_cgcore_top_down_constraint_enable()
461 * if it's enabled in a child.
470 if (!parent || !child) in test_cgcore_top_down_constraint_disable()
473 if (cg_create(parent)) in test_cgcore_top_down_constraint_disable()
476 if (cg_create(child)) in test_cgcore_top_down_constraint_disable()
479 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_cgcore_top_down_constraint_disable()
482 if (cg_write(child, "cgroup.subtree_control", "+memory")) in test_cgcore_top_down_constraint_disable()
485 if (!cg_write(parent, "cgroup.subtree_control", "-memory")) in test_cgcore_top_down_constraint_disable()
491 if (child) in test_cgcore_top_down_constraint_disable()
493 if (parent) in test_cgcore_top_down_constraint_disable()
502 * You can't add a pid to a domain parent if a controller is enabled.
511 if (!parent || !child) in test_cgcore_internal_process_constraint()
514 if (cg_create(parent)) in test_cgcore_internal_process_constraint()
517 if (cg_create(child)) in test_cgcore_internal_process_constraint()
520 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_cgcore_internal_process_constraint()
523 if (!cg_enter_current(parent)) in test_cgcore_internal_process_constraint()
526 if (!clone_into_cgroup_run_wait(parent)) in test_cgcore_internal_process_constraint()
532 if (child) in test_cgcore_internal_process_constraint()
534 if (parent) in test_cgcore_internal_process_constraint()
559 if (!src || !dst) in test_cgcore_proc_migration()
562 if (cg_create(src)) in test_cgcore_proc_migration()
564 if (cg_create(dst)) in test_cgcore_proc_migration()
567 if (cg_enter_current(src)) in test_cgcore_proc_migration()
571 if (pthread_create(&threads[c_threads], NULL, dummy_thread_fn, NULL)) in test_cgcore_proc_migration()
576 if (cg_read_lc(dst, "cgroup.threads") != n_threads + 1) in test_cgcore_proc_migration()
592 if (dst) in test_cgcore_proc_migration()
594 if (src) in test_cgcore_proc_migration()
613 if (proc_read_strstr(0, 1, "cgroup", lines[(i % 2) + 1])) in migrating_thread_fn()
635 if (!grps[1] || !grps[2] || !dom) in test_cgcore_thread_migration()
638 if (cg_create(dom)) in test_cgcore_thread_migration()
640 if (cg_create(grps[1])) in test_cgcore_thread_migration()
642 if (cg_create(grps[2])) in test_cgcore_thread_migration()
645 if (cg_write(grps[1], "cgroup.type", "threaded")) in test_cgcore_thread_migration()
647 if (cg_write(grps[2], "cgroup.type", "threaded")) in test_cgcore_thread_migration()
650 if (cg_enter_current(grps[1])) in test_cgcore_thread_migration()
653 if (pthread_create(&thr, NULL, migrating_thread_fn, grps)) in test_cgcore_thread_migration()
656 if (pthread_join(thr, &retval)) in test_cgcore_thread_migration()
659 if (retval) in test_cgcore_thread_migration()
663 if (proc_read_strstr(0, 1, "cgroup", line)) in test_cgcore_thread_migration()
670 if (grps[2]) in test_cgcore_thread_migration()
672 if (grps[1]) in test_cgcore_thread_migration()
674 if (dom) in test_cgcore_thread_migration()
698 if (!cg_test_a || !cg_test_b) in test_cgcore_lesser_euid_open()
704 if (!cg_test_a_procs || !cg_test_b_procs) in test_cgcore_lesser_euid_open()
707 if (cg_create(cg_test_a) || cg_create(cg_test_b)) in test_cgcore_lesser_euid_open()
710 if (cg_enter_current(cg_test_a)) in test_cgcore_lesser_euid_open()
713 if (chown(cg_test_a_procs, test_euid, -1) || in test_cgcore_lesser_euid_open()
718 if (seteuid(test_euid)) in test_cgcore_lesser_euid_open()
723 if (seteuid(saved_uid)) in test_cgcore_lesser_euid_open()
726 if (cg_test_b_procs_fd < 0) in test_cgcore_lesser_euid_open()
729 if (write(cg_test_b_procs_fd, "0", 1) >= 0 || errno != EACCES) in test_cgcore_lesser_euid_open()
736 if (cg_test_b_procs_fd >= 0) in test_cgcore_lesser_euid_open()
738 if (cg_test_b) in test_cgcore_lesser_euid_open()
740 if (cg_test_a) in test_cgcore_lesser_euid_open()
780 if (!nsdelegate) in test_cgcore_lesser_ns_open()
786 if (!cg_test_a || !cg_test_b) in test_cgcore_lesser_ns_open()
792 if (!cg_test_a_procs || !cg_test_b_procs) in test_cgcore_lesser_ns_open()
795 if (cg_create(cg_test_a) || cg_create(cg_test_b)) in test_cgcore_lesser_ns_open()
798 if (cg_enter_current(cg_test_b)) in test_cgcore_lesser_ns_open()
801 if (chown(cg_test_a_procs, test_euid, -1) || in test_cgcore_lesser_ns_open()
809 if (pid < 0) in test_cgcore_lesser_ns_open()
812 if (waitpid(pid, &status, 0) < 0) in test_cgcore_lesser_ns_open()
815 if (!WIFEXITED(status)) in test_cgcore_lesser_ns_open()
819 if (cg_test_b_procs_fd < 0) in test_cgcore_lesser_ns_open()
822 if (cg_enter_current(cg_test_a)) in test_cgcore_lesser_ns_open()
825 if ((status = write(cg_test_b_procs_fd, "0", 1)) >= 0 || errno != ENOENT) in test_cgcore_lesser_ns_open()
832 if (cg_test_b_procs_fd >= 0) in test_cgcore_lesser_ns_open()
834 if (cg_test_b) in test_cgcore_lesser_ns_open()
836 if (cg_test_a) in test_cgcore_lesser_ns_open()
870 if (cg_find_unified_root(root, sizeof(root), &nsdelegate)) in main()
873 if (cg_read_strstr(root, "cgroup.subtree_control", "memory")) in main()
874 if (cg_write(root, "cgroup.subtree_control", "+memory")) in main()