Lines Matching refs:mqdp

163 mqdes_register(mqdes_t *mqdp)
190 ind = MQDES_HASH(mqdp);
192 mqdp->mqd_next = tmqdp;
193 mqdp->mqd_prev = NULL;
195 tmqdp->mqd_prev = mqdp;
196 mq_list[ind] = mqdp;
203 mqdes_unregister(mqdes_t *mqdp)
208 if (mqdp->mqd_next != NULL)
209 mqdp->mqd_next->mqd_prev = mqdp->mqd_prev;
210 if (mqdp->mqd_prev != NULL)
211 mqdp->mqd_prev->mqd_next = mqdp->mqd_next;
212 ind = MQDES_HASH(mqdp);
213 if (mq_list[ind] == mqdp)
214 mq_list[ind] = mqdp->mqd_next;
219 mqdes_is_valid(mqdes_t *mqdp)
228 for (tp = mq_list[MQDES_HASH(mqdp)]; tp != NULL; tp = tp->mqd_next) {
229 if (tp == mqdp)
237 mq_is_valid(mqdes_t *mqdp)
244 if (mqdp != NULL && mqdp != MQ_RESERVED && mqdes_is_valid(mqdp)) {
245 return (mqdp->mqd_magic == MQ_MAGIC);
431 owner_dead(mqdes_t *mqdp, int error)
433 mqhdr_t *mqhp = mqdp->mqd_mq;
435 mqdp->mqd_ownerdead = 1;
461 mqdes_t *mqdp;
555 if ((mqdp = (mqdes_t *)malloc(sizeof (mqdes_t))) == NULL) {
592 if (mqdes_register(mqdp) != 0)
598 mqdp->mqd_flags = (oflag - FOPEN) & (FREAD|FWRITE);
607 mqdp->mqd_mq = mqhp;
608 mqdp->mqd_mqdn = mqdnp;
609 mqdp->mqd_magic = MQ_MAGIC;
610 mqdp->mqd_tcd = NULL;
611 mqdp->mqd_ownerdead = 0;
613 return ((mqd_t)mqdp);
615 mqdes_unregister(mqdp);
626 free((void *)mqdp);
638 mq_close_cleanup(mqdes_t *mqdp)
640 mqhdr_t *mqhp = mqdp->mqd_mq;
641 struct mq_dn *mqdnp = mqdp->mqd_mqdn;
644 mqdp->mqd_magic = 0;
645 if (!mqdp->mqd_ownerdead)
648 mqdes_unregister(mqdp);
650 free(mqdp);
658 mqdes_t *mqdp = (mqdes_t *)mqdes;
663 if (!mq_is_valid(mqdp)) {
668 mqhp = mqdp->mqd_mq;
670 mqdp->mqd_ownerdead = 1;
676 if (mqhp->mq_des == (uintptr_t)mqdp &&
684 pthread_cleanup_push(mq_close_cleanup, mqdp);
685 if ((tcdp = mqdp->mqd_tcd) != NULL) {
686 mqdp->mqd_tcd = NULL;
724 mqdes_t *mqdp = (mqdes_t *)mqdes;
736 if (!mq_is_valid(mqdp) || (mqdp->mqd_flags & FWRITE) == 0) {
741 mqhp = mqdp->mqd_mq;
752 if (mqdp->mqd_mqdn->mqdn_flags & O_NONBLOCK)
778 owner_dead(mqdp, err);
860 mqdes_t *mqdp = (mqdes_t *)mqdes;
872 if (!mq_is_valid(mqdp) || (mqdp->mqd_flags & FREAD) == 0) {
877 mqhp = mqdp->mqd_mq;
893 if ((mqdp->mqd_mqdn->mqdn_flags & O_NONBLOCK) != 0) {
926 owner_dead(mqdp, err);
995 mqdes_t *mqdp = (mqdes_t *)mqdes;
1008 if (!mq_is_valid(mqdp)) {
1013 mqhp = mqdp->mqd_mq;
1016 mqdp->mqd_ownerdead = 1;
1024 if (mqhp->mq_des == (uintptr_t)mqdp &&
1028 if ((tcdp = mqdp->mqd_tcd) != NULL) {
1032 tcdp = mqdp->mqd_tcd;
1033 mqdp->mqd_tcd = NULL;
1077 if ((tcdp = mqdp->mqd_tcd) != NULL &&
1079 mqdp->mqd_tcd = NULL;
1082 if ((tcdp = mqdp->mqd_tcd) == NULL) {
1096 mqdp->mqd_tcd = tcdp;
1110 mqhp->mq_des = (uintptr_t)mqdp;
1115 tcdp->tcd_msg_object = mqdp;
1139 mqdes_t *mqdp = (mqdes_t *)mqdes;
1143 if (!mq_is_valid(mqdp)) {
1152 mqhp = mqdp->mqd_mq;
1153 omqstat->mq_flags = mqdp->mqd_mqdn->mqdn_flags;
1163 mqdp->mqd_mqdn->mqdn_flags = flag;
1171 mqdes_t *mqdp = (mqdes_t *)mqdes;
1175 if (!mq_is_valid(mqdp)) {
1180 mqhp = mqdp->mqd_mq;
1182 mqstat->mq_flags = mqdp->mqd_mqdn->mqdn_flags;
1197 mqdes_t *mqdp;
1204 for (mqdp = mq_list[i]; mqdp != NULL; mqdp = mqdp->mqd_next) {
1205 if ((tcdp = mqdp->mqd_tcd) != NULL) {
1206 mqdp->mqd_tcd = NULL;