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 Linux machine. */
29 #ifdef HAVE_STDIO_H /* it does ***not** necessarily mean it's Linux */
30 #ifdef HAVE_STDLIB_H /* but it will define some variables that we */
31 #ifdef HAVE_SYS_TYPES_H /* later check for, to confirm it's Linux */
32 #ifdef HAVE_SYS_UTSNAME_H /* later check for, to confirm it's Linux */
35 #ifdef HAVE_SYS_SYSINFO_H
36 #ifdef HAVE_LINUX_IP_H /* I don't want to include this, but it is proof
37 that the system is Linux */
41 #include <sys/types.h>
42 #include <sys/utsname.h>
45 #include <sys/sysinfo.h>
59 #endif /* End of including header files likely to be on Linux system */
62 #define BYTES_PER_MB 1048576
64 int try_linux(struct computer_data *data)
66 #ifdef HAVE_STDIO_H /* it does ***not** necessarily mean it's Linux */
67 #ifdef HAVE_STDLIB_H /* but it will define some variables that we */
68 #ifdef HAVE_SYS_TYPES_H /* later check for, to confirm it's Linux */
69 #ifdef HAVE_SYS_UTSNAME_H /* later check for, to confirm it's Linux */
72 #ifdef HAVE_SYS_SYSINFO_H
73 #ifdef HAVE_LINUX_IP_H /* I don't want to include this, but it is proof
74 that the system is Linux */
76 /* Obtain the maximum number of CPUs supported on the Linux system */
78 /* Obtain the number of CPUs online on the Linux system */
80 #ifdef _SC_NPROCESSORS_CONF
81 if( sysconf(_SC_NPROCESSORS_CONF) >= 1)
82 sprintf(data->cpus,"%d", sysconf( _SC_NPROCESSORS_CONF));
85 /* Obtain the of CPU and FPU on the Linux box */
87 /* Obtain the RAM on the Linux system if possible. Currently this is
88 done in try_portable.c, but is not 100% accurate on Linux */
90 /* Obtain operating system informaton */
92 /* Obtain the manufacturer - I don't think this will be too possible,
93 but it might be, but clearly some boxes are going to be generic. */
95 /* Obtain the Platform */
97 return(PROBABLY_LINUX);