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 IRIX machine. */
31 #ifdef HAVE_SYS_TYPES_H
32 #ifdef HAVE_SYS_SYSCTL_H
38 /* On BSD 3.2 for SPARC, NGROUPS don't seem to be defined, but
39 it is on other systems. To be safe, the relavant header files
40 will only be included if NGROUPS is not defined */
44 #ifdef HAVE_SYS_PARAM_H
45 #include <sys/param.h>
48 #ifdef HAVE_SYS_SYSLIMITS_H
49 #include <sys/syslimits.h>
52 #endif /* End of ifndef NGROUPS */
54 #include <sys/types.h>
55 #include <sys/sysctl.h>
65 int try_bsd(struct computer_data *data)
69 #ifdef HAVE_SYS_TYPES_H
70 #ifdef HAVE_SYS_SYSCTL_H
74 int cpus, ram, mib[2], ret;
77 /* Obtain the maximum number of CPUs supported on the BSD system */
79 /* Obtain the number of CPUs online on the BSD system */
85 ret=sysctl(mib, 2, &cpus, &len, NULL, 0);
86 if (cpus>= 1 && ret==0)
87 sprintf(data->cpus,"%d ", cpus);
90 /* Obtain the CPU speed in MHz - as a double */
92 /* Obtain the of CPU and FPU on the ???? box */
94 /* Obtain the RAM, cache etc on the BSD system. */
99 ret=sysctl(mib, 2, &ram , &len, NULL, 0);
100 if( ram > 0 && ret ==0 )
101 sprintf(data->memory,"%d", ram/(1024*1024));
105 /* Obtain the manufacturer */
107 /* sprintf(data->hw_provider,"SGI"); */
108 return(PROBABLY_BSD);