2 atlc - arbitrary transmission line calculator, for the analysis of
3 transmission lines are directional couplers.
5 Copyright (C) 2002. Dr. David Kirkby, PhD (G8WRB).
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either package_version 2
10 of the License, or (at your option) any later package_version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 Dr. David Kirkby, e-mail drkirkby@ntlworld.com
25 /* Try to get data. This will work only on a Solaris machine. */
29 #ifdef HAVE_SYS_PARAM_H /* This looks for header files that should be */
30 #ifdef HAVE_SYS_PROCESSOR_H /* present on Solaris. If they are all present */
31 #ifdef HAVE_STDIO_H /* it does ***not** necessarily mean it's Solaris */
32 #ifdef HAVE_STDLIB_H /* but it will define some variables that we */
33 #ifdef HAVE_SYS_TYPES_H /* later check for, to confirm it's Solaris */
35 #ifdef HAVE_SYS_UNISTD_H
37 #ifdef HAVE_SYS_UTSNAME_H
38 #ifdef HAVE_SYS_SYSTEMINFO_H
40 #include <sys/param.h> /* Include the header files */
41 #include <sys/processor.h> /* Include the header files */
44 #include <sys/types.h>
47 #include <sys/unistd.h>
48 #include <sys/utsname.h>
49 #include <sys/systeminfo.h>
60 #endif /* End of including header files likely to be on Solaris system */
64 int try_solaris(struct computer_data *data)
67 #ifdef HAVE_SYS_SYSTEMINFO_H
68 #ifdef HAVE_SYS_PARAM_H
69 #ifdef HAVE_SYS_PROCESSOR_H
72 #ifdef HAVE_SYS_TYPES_H
74 #ifdef HAVE_SYS_UNISTD_H
76 #ifdef HAVE_SYS_UTSNAME_H
79 #ifdef _SC_AVPHYS_PAGES
81 int clock_speed_in_MHz;
82 #ifdef HAVE_PROCESSOR_INFO
83 processor_info_t infop;
86 #ifdef _SC_NPROCESSORS_MAX
89 /* Obtain the maximum number of CPUs supported on the Solaris system */
91 max_CPUs=(long) sysconf(_SC_NPROCESSORS_MAX);
93 sprintf(data->max_cpus,"%ld",max_CPUs);
96 #ifdef HAVE_PROCESSOR_INFO
97 /* Obtain the of CPU and FPU on the Solaris box */
98 if( processor_info((processorid_t) 0, &infop) == 0)
100 strcpy(data->cpu_type,infop.pi_processor_type);
101 strcpy(data->fpu_type,infop.pi_fputypes);
102 clock_speed_in_MHz=(int) infop.pi_clock;
103 if(clock_speed_in_MHz > 1)
104 sprintf(data->mhz,"%d",clock_speed_in_MHz);
108 /* Obtain the Platform */
110 sysinfo(SI_PLATFORM,data->hw_platform,MAX_SIZE);
113 /* Obtain the manufacturer */
114 #ifdef SI_HW_PROVIDER
115 sysinfo(SI_HW_PROVIDER,data->hw_provider,MAX_SIZE);
118 return(PROBABLY_SOLARIS);