| 699 | } |
| 700 | |
| 701 | cs_error_t cpg_leave ( |
| 702 | cpg_handle_t handle, |
| 703 | const struct cpg_name *group) |
| 704 | { |
| 705 | cs_error_t error; |
| 706 | struct cpg_inst *cpg_inst; |
| 707 | struct iovec iov[2]; |
| 708 | struct req_lib_cpg_leave req_lib_cpg_leave; |
| 709 | struct res_lib_cpg_leave res_lib_cpg_leave; |
| 710 | |
| 711 | if (group->length > CPG_MAX_NAME_LENGTH) { |
| 712 | return (CS_ERR_NAME_TOO_LONG); |
| 713 | } |
| 714 | |
| 715 | error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst)); |
| 716 | if (error != CS_OK) { |
| 717 | return (error); |
| 718 | } |
| 719 | |
| 720 | req_lib_cpg_leave.header.size = sizeof (struct req_lib_cpg_leave); |
| 721 | req_lib_cpg_leave.header.id = MESSAGE_REQ_CPG_LEAVE; |
| 722 | req_lib_cpg_leave.pid = getpid(); |
| 723 | marshall_to_mar_cpg_name_t (&req_lib_cpg_leave.group_name, |
| 724 | group); |
| 725 | |
| 726 | iov[0].iov_base = (void *)&req_lib_cpg_leave; |
| 727 | iov[0].iov_len = sizeof (struct req_lib_cpg_leave); |
| 728 | |
| 729 | do { |
| 730 | error = coroipcc_msg_send_reply_receive (cpg_inst->c, iov, 1, |
| 731 | &res_lib_cpg_leave, sizeof (struct res_lib_cpg_leave)); |
| 732 | |
| 733 | if (error != CS_OK) { |
| 734 | goto error_exit; |
| 735 | } |
| 736 | } while (res_lib_cpg_leave.header.error == CS_ERR_BUSY); |
| 737 | |
| 738 | error = res_lib_cpg_leave.header.error; |
| 739 | |
| 740 | error_exit: |
| 741 | hdb_handle_put (&cpg_handle_t_db, handle); |
| 742 | |
| 743 | return (error); |
| 744 | } |
| 745 | |
| 746 | cs_error_t cpg_membership_get ( |
| 747 | cpg_handle_t handle, |