Print this page
2976 remove useless offsetof() macros


  28 #include <limits.h>
  29 #include <strings.h>
  30 #include <stdio.h>
  31 #include <unistd.h>
  32 #include <sys/wait.h>
  33 #include <sys/stat.h>
  34 #include <fcntl.h>
  35 #include <fm/fmd_log.h>
  36 #include <sys/fm/protocol.h>
  37 #include <fm/libtopo.h>
  38 #include <fm/fmd_adm.h>
  39 #include <fm/fmd_msg.h>
  40 #include <dlfcn.h>
  41 #include <sys/systeminfo.h>
  42 #include <sys/utsname.h>
  43 #include <libintl.h>
  44 #include <locale.h>
  45 #include <sys/smbios.h>
  46 #include <libdevinfo.h>
  47 #include <stdlib.h>
  48 
  49 #define offsetof(s, m)  ((size_t)(&(((s*)0)->m)))
  50 
  51 /*
  52  * Fault records are added to catalog by calling add_fault_record_to_catalog()
  53  * records are stored in order of importance to the system.
  54  * If -g flag is set or not_suppressed is not set and the class fru, fault,
  55  * type are the same then details are merged into an existing record, with uuid
  56  * records are stored in time order.
  57  * For each record information is extracted from nvlist and merged into linked
  58  * list each is checked for identical records for which percentage certainty are
  59  * added together.
  60  * print_catalog() is called to print out catalog and release external resources
  61  *
  62  *                         /---------------\
  63  *      status_rec_list -> |               | -|
  64  *                         \---------------/
  65  *                                \/
  66  *                         /---------------\    /-------\    /-------\
  67  *      status_fru_list    | status_record | -> | uurec | -> | uurec | -|
  68  *            \/           |               | |- |       | <- |       |
  69  *      /-------------\    |               |    \-------/    \-------/




  28 #include <limits.h>
  29 #include <strings.h>
  30 #include <stdio.h>
  31 #include <unistd.h>
  32 #include <sys/wait.h>
  33 #include <sys/stat.h>
  34 #include <fcntl.h>
  35 #include <fm/fmd_log.h>
  36 #include <sys/fm/protocol.h>
  37 #include <fm/libtopo.h>
  38 #include <fm/fmd_adm.h>
  39 #include <fm/fmd_msg.h>
  40 #include <dlfcn.h>
  41 #include <sys/systeminfo.h>
  42 #include <sys/utsname.h>
  43 #include <libintl.h>
  44 #include <locale.h>
  45 #include <sys/smbios.h>
  46 #include <libdevinfo.h>
  47 #include <stdlib.h>
  48 #include <stddef.h>

  49 
  50 /*
  51  * Fault records are added to catalog by calling add_fault_record_to_catalog()
  52  * records are stored in order of importance to the system.
  53  * If -g flag is set or not_suppressed is not set and the class fru, fault,
  54  * type are the same then details are merged into an existing record, with uuid
  55  * records are stored in time order.
  56  * For each record information is extracted from nvlist and merged into linked
  57  * list each is checked for identical records for which percentage certainty are
  58  * added together.
  59  * print_catalog() is called to print out catalog and release external resources
  60  *
  61  *                         /---------------\
  62  *      status_rec_list -> |               | -|
  63  *                         \---------------/
  64  *                                \/
  65  *                         /---------------\    /-------\    /-------\
  66  *      status_fru_list    | status_record | -> | uurec | -> | uurec | -|
  67  *            \/           |               | |- |       | <- |       |
  68  *      /-------------\    |               |    \-------/    \-------/