1 --- hexchat-2.14.3/src/common/util.c 2019-12-21 07:43:47.702403000 +0000
2 +++ hexchat-2.14.3/src/common/util.c 2020-01-02 12:03:02.367758918 +0000
7 +#if defined (__SVR4) && defined (__sun)
12 file_part (char *file)
14 @@ -360,7 +364,7 @@ strip_hidden_attribute (char *src, char
18 -#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__) || defined (__CYGWIN__)
19 +#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__) || defined (__CYGWIN__) || (defined (__SVR4) && defined (__sun))
22 get_cpu_info (double *mhz, int *cpus)
23 @@ -450,6 +454,37 @@ get_cpu_info (double *mhz, int *cpus)
24 *mhz = (freq / 1000000);
27 +#if defined (__SVR4) && defined (__sun)
31 + kstat_named_t *knp = NULL;
35 + fprintf (stderr, "get speed: kstat error %d\n", errno);
39 + ksp = kstat_lookup(kc, "cpu_info", -1, NULL);
40 + for (; ksp != NULL; ksp = ksp->ks_next) {
41 + if (strcmp(ksp->ks_module, "cpu_info"))
45 + kstat_read(kc, ksp, NULL);
48 + knp = kstat_data_lookup(ksp, "clock_MHz");
54 + *mhz = knp->value.i32;
61 @@ -495,7 +530,7 @@ get_sys_str (int with_cpu)
63 get_sys_str (int with_cpu)
65 -#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__) || defined (__CYGWIN__)
66 +#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__) || defined (__CYGWIN__) || (defined (__SVR4) && defined (__sun))
70 @@ -507,7 +542,7 @@ get_sys_str (int with_cpu)
74 -#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__) || defined (__CYGWIN__)
75 +#if defined (__linux__) || defined (__FreeBSD__) || defined (__APPLE__) || defined (__CYGWIN__) || (defined (__SVR4) && defined (__sun))
76 get_cpu_info (&mhz, &cpus);