Print this page
3373 gcc >= 4.5 concerns about offsetof()


5626                         q = &rdc_u_info[p->index];
5627                         q->autosync = urdc->autosync;
5628                         rdc_write_state(q);
5629                 }
5630         }
5631 
5632 done:
5633         rdc_group_exit(krdc);
5634 
5635         mutex_enter(&rdc_conf_lock);
5636         wakeup_busy(krdc);
5637         mutex_exit(&rdc_conf_lock);
5638 
5639         return (rc);
5640 }
5641 
5642 /*
5643  * Yet another standard thing that is not standard ...
5644  */
5645 #ifndef offsetof
5646 #define offsetof(s, m)  ((size_t)(&((s *)0)->m))




5647 #endif
5648 
5649 static int
5650 rdc_status(void *arg, int mode, rdc_config_t *uparms, spcs_s_info_t kstatus)
5651 {
5652         rdc_k_info_t *krdc;
5653         rdc_u_info_t *urdc;
5654         disk_queue *dqp;
5655         int rc = 0;
5656         int index;
5657         char *ptr;
5658         extern int rdc_status_copy32(const void *, void *, size_t, int);
5659 
5660         mutex_enter(&rdc_conf_lock);
5661         index = rdc_lookup_byname(uparms->rdc_set);
5662         if (index >= 0)
5663                 krdc = &rdc_k_info[index];
5664         if (index < 0 || (krdc->type_flag & RDC_DISABLEPEND)) {
5665                 mutex_exit(&rdc_conf_lock);
5666                 spcs_s_add(kstatus, RDC_EALREADY, uparms->rdc_set->primary.file,




5626                         q = &rdc_u_info[p->index];
5627                         q->autosync = urdc->autosync;
5628                         rdc_write_state(q);
5629                 }
5630         }
5631 
5632 done:
5633         rdc_group_exit(krdc);
5634 
5635         mutex_enter(&rdc_conf_lock);
5636         wakeup_busy(krdc);
5637         mutex_exit(&rdc_conf_lock);
5638 
5639         return (rc);
5640 }
5641 
5642 /*
5643  * Yet another standard thing that is not standard ...
5644  */
5645 #ifndef offsetof
5646 #if defined(__GNUC__)
5647 #define offsetof(s, m)  __builtin_offsetof(s, m)
5648 #else
5649 #define offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
5650 #endif
5651 #endif
5652 
5653 static int
5654 rdc_status(void *arg, int mode, rdc_config_t *uparms, spcs_s_info_t kstatus)
5655 {
5656         rdc_k_info_t *krdc;
5657         rdc_u_info_t *urdc;
5658         disk_queue *dqp;
5659         int rc = 0;
5660         int index;
5661         char *ptr;
5662         extern int rdc_status_copy32(const void *, void *, size_t, int);
5663 
5664         mutex_enter(&rdc_conf_lock);
5665         index = rdc_lookup_byname(uparms->rdc_set);
5666         if (index >= 0)
5667                 krdc = &rdc_k_info[index];
5668         if (index < 0 || (krdc->type_flag & RDC_DISABLEPEND)) {
5669                 mutex_exit(&rdc_conf_lock);
5670                 spcs_s_add(kstatus, RDC_EALREADY, uparms->rdc_set->primary.file,