Lines Matching full:id

123 	semid_t id;  in ksem_open_should_fail()  local
125 if (ksem_open(&id, path, flags, mode, value) >= 0) { in ksem_open_should_fail()
127 ksem_close(id); in ksem_open_should_fail()
161 ksem_close_should_fail(semid_t id, int error) in ksem_close_should_fail() argument
164 if (ksem_close(id) >= 0) { in ksem_close_should_fail()
182 semid_t id; in ksem_init_should_fail() local
184 if (ksem_init(&id, value) >= 0) { in ksem_init_should_fail()
186 ksem_destroy(id); in ksem_init_should_fail()
201 ksem_destroy_should_fail(semid_t id, int error) in ksem_destroy_should_fail() argument
204 if (ksem_destroy(id) >= 0) { in ksem_destroy_should_fail()
220 ksem_post_should_fail(semid_t id, int error) in ksem_post_should_fail() argument
223 if (ksem_post(id) >= 0) { in ksem_post_should_fail()
237 semid_t id; in open_after_unlink() local
239 if (ksem_open(&id, TEST_PATH, O_CREAT, 0777, 1) < 0) { in open_after_unlink()
243 ksem_close(id); in open_after_unlink()
312 semid_t id; in exclusive_create_existing_semaphore() local
314 if (ksem_open(&id, TEST_PATH, O_CREAT, 0777, 1) < 0) { in exclusive_create_existing_semaphore()
318 ksem_close(id); in exclusive_create_existing_semaphore()
358 semid_t id; in destroy_named_semaphore() local
360 if (ksem_open(&id, TEST_PATH, O_CREAT, 0777, 1) < 0) { in destroy_named_semaphore()
365 ksem_destroy_should_fail(id, EINVAL); in destroy_named_semaphore()
367 ksem_close(id); in destroy_named_semaphore()
375 semid_t id; in close_unnamed_semaphore() local
377 if (ksem_init(&id, 1) < 0) { in close_unnamed_semaphore()
382 ksem_close_should_fail(id, EINVAL); in close_unnamed_semaphore()
384 ksem_destroy(id); in close_unnamed_semaphore()
407 semid_t id; in create_unnamed_semaphore() local
409 if (ksem_init(&id, 1) < 0) { in create_unnamed_semaphore()
414 if (ksem_destroy(id) < 0) { in create_unnamed_semaphore()
425 semid_t id; in open_named_semaphore() local
427 if (ksem_open(&id, TEST_PATH, O_CREAT, 0777, 1) < 0) { in open_named_semaphore()
432 if (ksem_close(id) < 0) { in open_named_semaphore()
519 checkvalue(semid_t id, int expected) in checkvalue() argument
523 if (ksem_getvalue(id, &val) < 0) { in checkvalue()
537 semid_t id; in post_test() local
539 if (ksem_init(&id, 1) < 0) { in post_test()
543 if (checkvalue(id, 1) < 0) { in post_test()
544 ksem_destroy(id); in post_test()
547 if (ksem_post(id) < 0) { in post_test()
549 ksem_destroy(id); in post_test()
552 if (checkvalue(id, 2) < 0) { in post_test()
553 ksem_destroy(id); in post_test()
556 if (ksem_destroy(id) < 0) { in post_test()
567 semid_t id; in use_after_unlink_test() local
573 if (ksem_open(&id, TEST_PATH, O_CREAT | O_EXCL, 0777, 1) < 0) { in use_after_unlink_test()
579 ksem_close(id); in use_after_unlink_test()
582 if (checkvalue(id, 1) < 0) { in use_after_unlink_test()
583 ksem_close(id); in use_after_unlink_test()
588 if (ksem_post(id) < 0) { in use_after_unlink_test()
590 ksem_close(id); in use_after_unlink_test()
593 if (checkvalue(id, 2) < 0) { in use_after_unlink_test()
594 ksem_close(id); in use_after_unlink_test()
599 if (ksem_wait(id) < 0) { in use_after_unlink_test()
601 ksem_close(id); in use_after_unlink_test()
604 if (checkvalue(id, 1) < 0) { in use_after_unlink_test()
605 ksem_close(id); in use_after_unlink_test()
609 if (ksem_close(id) < 0) { in use_after_unlink_test()
620 semid_t id; in unlocked_trywait() local
622 if (ksem_init(&id, 1) < 0) { in unlocked_trywait()
628 if (ksem_trywait(id) < 0) { in unlocked_trywait()
630 ksem_destroy(id); in unlocked_trywait()
633 if (checkvalue(id, 0) < 0) { in unlocked_trywait()
634 ksem_destroy(id); in unlocked_trywait()
638 if (ksem_destroy(id) < 0) { in unlocked_trywait()
649 semid_t id; in locked_trywait() local
651 if (ksem_init(&id, 0) < 0) { in locked_trywait()
657 if (ksem_trywait(id) >= 0) { in locked_trywait()
659 ksem_destroy(id); in locked_trywait()
664 ksem_destroy(id); in locked_trywait()
667 if (checkvalue(id, 0) < 0) { in locked_trywait()
668 ksem_destroy(id); in locked_trywait()
672 if (ksem_destroy(id) < 0) { in locked_trywait()
725 schedule_post(semid_t id, u_int msec) in schedule_post() argument
740 alarm_id = id; in schedule_post()
752 timedwait(semid_t id, u_int msec, u_int *delta, int error) in timedwait() argument
763 if (ksem_timedwait(id, &end) < 0) { in timedwait()
785 semid_t id; in unlocked_timedwait() local
788 if (ksem_init(&id, 1) < 0) { in unlocked_timedwait()
794 if (timedwait(id, 5000, &elapsed, 0) < 0) { in unlocked_timedwait()
795 ksem_destroy(id); in unlocked_timedwait()
800 ksem_destroy(id); in unlocked_timedwait()
803 if (checkvalue(id, 0) < 0) { in unlocked_timedwait()
804 ksem_destroy(id); in unlocked_timedwait()
808 if (ksem_destroy(id) < 0) { in unlocked_timedwait()
819 semid_t id; in expired_timedwait() local
822 if (ksem_init(&id, 0) < 0) { in expired_timedwait()
828 if (timedwait(id, 2500, &elapsed, ETIMEDOUT) < 0) { in expired_timedwait()
829 ksem_destroy(id); in expired_timedwait()
836 ksem_destroy(id); in expired_timedwait()
839 if (checkvalue(id, 0) < 0) { in expired_timedwait()
840 ksem_destroy(id); in expired_timedwait()
844 if (ksem_destroy(id) < 0) { in expired_timedwait()
855 semid_t id; in locked_timedwait() local
858 if (ksem_init(&id, 0) < 0) { in locked_timedwait()
868 if (schedule_post(id, 1000) < 0) { in locked_timedwait()
869 ksem_destroy(id); in locked_timedwait()
872 if (timedwait(id, 2000, &elapsed, 0) < 0) { in locked_timedwait()
874 ksem_destroy(id); in locked_timedwait()
882 ksem_destroy(id); in locked_timedwait()
886 ksem_destroy(id); in locked_timedwait()
890 if (ksem_destroy(id) < 0) { in locked_timedwait()
899 testwait(semid_t id, u_int *delta) in testwait() argument
907 if (ksem_wait(id) < 0) { in testwait()
924 semid_t id; in unlocked_wait() local
927 if (ksem_init(&id, 1) < 0) { in unlocked_wait()
933 if (testwait(id, &elapsed) < 0) { in unlocked_wait()
934 ksem_destroy(id); in unlocked_wait()
939 ksem_destroy(id); in unlocked_wait()
942 if (checkvalue(id, 0) < 0) { in unlocked_wait()
943 ksem_destroy(id); in unlocked_wait()
947 if (ksem_destroy(id) < 0) { in unlocked_wait()
958 semid_t id; in locked_wait() local
961 if (ksem_init(&id, 0) < 0) { in locked_wait()
970 if (schedule_post(id, 1000) < 0) { in locked_wait()
971 ksem_destroy(id); in locked_wait()
974 if (testwait(id, &elapsed) < 0) { in locked_wait()
976 ksem_destroy(id); in locked_wait()
984 ksem_destroy(id); in locked_wait()
988 ksem_destroy(id); in locked_wait()
992 if (ksem_destroy(id) < 0) { in locked_wait()
1008 semid_t id; in wait_twoproc_child() local
1010 if (ksem_open(&id, TEST_PATH, 0, 0, 0) < 0) in wait_twoproc_child()
1012 if (ksem_wait(id) < 0) in wait_twoproc_child()
1014 if (ksem_close(id) < 0) in wait_twoproc_child()
1022 semid_t id; in wait_twoproc_test() local
1025 if (ksem_open(&id, TEST_PATH, O_CREAT, 0777, 0)) { in wait_twoproc_test()
1030 if (schedule_post(id, 500) < 0) { in wait_twoproc_test()
1031 ksem_close(id); in wait_twoproc_test()
1038 ksem_close(id); in wait_twoproc_test()
1063 ksem_close(id); in wait_twoproc_test()
1071 semid_t id; in maxvalue_test() local
1074 if (ksem_init(&id, SEM_VALUE_MAX) < 0) { in maxvalue_test()
1078 if (ksem_getvalue(id, &val) < 0) { in maxvalue_test()
1080 ksem_destroy(id); in maxvalue_test()
1085 ksem_destroy(id); in maxvalue_test()
1090 ksem_destroy(id); in maxvalue_test()
1093 if (ksem_destroy(id) < 0) { in maxvalue_test()
1104 semid_t id; in maxvalue_post_test() local
1106 if (ksem_init(&id, SEM_VALUE_MAX) < 0) { in maxvalue_post_test()
1111 ksem_post_should_fail(id, EOVERFLOW); in maxvalue_post_test()
1113 ksem_destroy(id); in maxvalue_post_test()
1122 semid_t id; in busy_destroy_test() local
1133 if (ksem_init(&id, 0) < 0) { in busy_destroy_test()
1144 ksem_destroy(id); in busy_destroy_test()
1149 ksem_wait(id); in busy_destroy_test()
1162 ksem_destroy(id); in busy_destroy_test()
1173 ksem_destroy_should_fail(id, EBUSY); in busy_destroy_test()
1176 ksem_post(id); in busy_destroy_test()
1178 ksem_destroy(id); in busy_destroy_test()
1185 semid_t id; in exhaust_unnamed_child() local
1190 if (ksem_init(&id, 1) < 0) { in exhaust_unnamed_child()
1237 semid_t id; in exhaust_named_child() local
1243 if (ksem_open(&id, buffer, O_CREAT, 0777, 1) < 0) { in exhaust_named_child()