Lines Matching refs:mqdp
163 mq_is_valid(mqdes_t *mqdp)
171 if (mqdp != NULL && mqdp != MQ_RESERVED &&
172 ((uintptr_t)mqdp & 0x7) == 0) {
173 return (mqdp->mqd_magic == MQ_MAGIC);
360 owner_dead(mqdes_t *mqdp, int error)
362 mqhdr_t *mqhp = mqdp->mqd_mq;
364 mqdp->mqd_ownerdead = 1;
390 mqdes_t *mqdp;
484 if ((mqdp = (mqdes_t *)malloc(sizeof (mqdes_t))) == NULL) {
525 mqdp->mqd_flags = (oflag - FOPEN) & (FREAD|FWRITE);
534 mqdp->mqd_mq = mqhp;
535 mqdp->mqd_mqdn = mqdnp;
536 mqdp->mqd_magic = MQ_MAGIC;
537 mqdp->mqd_tcd = NULL;
538 mqdp->mqd_ownerdead = 0;
541 mqdp->mqd_next = mq_list;
542 mqdp->mqd_prev = NULL;
544 mq_list->mqd_prev = mqdp;
545 mq_list = mqdp;
547 return ((mqd_t)mqdp);
560 free((void *)mqdp);
572 mq_close_cleanup(mqdes_t *mqdp)
574 mqhdr_t *mqhp = mqdp->mqd_mq;
575 struct mq_dn *mqdnp = mqdp->mqd_mqdn;
578 mqdp->mqd_magic = 0;
579 if (!mqdp->mqd_ownerdead)
583 if (mqdp->mqd_next)
584 mqdp->mqd_next->mqd_prev = mqdp->mqd_prev;
585 if (mqdp->mqd_prev)
586 mqdp->mqd_prev->mqd_next = mqdp->mqd_next;
587 if (mq_list == mqdp)
588 mq_list = mqdp->mqd_next;
591 free(mqdp);
599 mqdes_t *mqdp = (mqdes_t *)mqdes;
604 if (!mq_is_valid(mqdp)) {
609 mqhp = mqdp->mqd_mq;
611 mqdp->mqd_ownerdead = 1;
617 if (mqhp->mq_des == (uintptr_t)mqdp &&
625 pthread_cleanup_push(mq_close_cleanup, mqdp);
626 if ((tcdp = mqdp->mqd_tcd) != NULL) {
627 mqdp->mqd_tcd = NULL;
665 mqdes_t *mqdp = (mqdes_t *)mqdes;
677 if (!mq_is_valid(mqdp) || (mqdp->mqd_flags & FWRITE) == 0) {
682 mqhp = mqdp->mqd_mq;
693 if (mqdp->mqd_mqdn->mqdn_flags & O_NONBLOCK)
719 owner_dead(mqdp, err);
801 mqdes_t *mqdp = (mqdes_t *)mqdes;
813 if (!mq_is_valid(mqdp) || (mqdp->mqd_flags & FREAD) == 0) {
818 mqhp = mqdp->mqd_mq;
834 if ((mqdp->mqd_mqdn->mqdn_flags & O_NONBLOCK) != 0) {
867 owner_dead(mqdp, err);
936 mqdes_t *mqdp = (mqdes_t *)mqdes;
949 if (!mq_is_valid(mqdp)) {
954 mqhp = mqdp->mqd_mq;
957 mqdp->mqd_ownerdead = 1;
965 if (mqhp->mq_des == (uintptr_t)mqdp &&
969 if ((tcdp = mqdp->mqd_tcd) != NULL) {
973 tcdp = mqdp->mqd_tcd;
974 mqdp->mqd_tcd = NULL;
1018 if ((tcdp = mqdp->mqd_tcd) != NULL &&
1020 mqdp->mqd_tcd = NULL;
1023 if ((tcdp = mqdp->mqd_tcd) == NULL) {
1037 mqdp->mqd_tcd = tcdp;
1051 mqhp->mq_des = (uintptr_t)mqdp;
1056 tcdp->tcd_msg_object = mqdp;
1080 mqdes_t *mqdp = (mqdes_t *)mqdes;
1084 if (!mq_is_valid(mqdp)) {
1093 mqhp = mqdp->mqd_mq;
1094 omqstat->mq_flags = mqdp->mqd_mqdn->mqdn_flags;
1104 mqdp->mqd_mqdn->mqdn_flags = flag;
1112 mqdes_t *mqdp = (mqdes_t *)mqdes;
1116 if (!mq_is_valid(mqdp)) {
1121 mqhp = mqdp->mqd_mq;
1123 mqstat->mq_flags = mqdp->mqd_mqdn->mqdn_flags;
1138 mqdes_t *mqdp;
1140 for (mqdp = mq_list; mqdp; mqdp = mqdp->mqd_next) {
1141 if ((tcdp = mqdp->mqd_tcd) != NULL) {
1142 mqdp->mqd_tcd = NULL;