|
|
An application compiled using the UnixWare and OpenServer Development Kit for UnixWare or SCO OpenServer may need to know which system it is running on.
Modifications have been made to the following interfaces to allow UnixWare and OpenServer Development Kit-compiled applications (together with the Binary Compatibility Module, if the application is running on SCO OpenServer Release 5 or SCO UnixWare 2.1.X) to determine the system on which they are running:
The UnixWare 7 uname command is included in the BCM modules for both SCO OpenServer Release 5 and SCO UnixWare 2.1.X. On SCO OpenServer Release 5, it is installed as /udk/bin/uname. On SCO UnixWare 2.1.X, it replaces the standard uname command in /bin/uname.
Applications (shell scripts) that need to know on which of these systems they are being executed should include the /udk/bin directory in the PATH environment variable list before /bin. This way, the application will execute the UnixWare 7 uname command on all systems that support the UDK.
So, in shell scripts, you should use:
PATH=/udk/bin:$PATH unameto get the UDK version of uname on all systems.
To check whether a system has the UDK installed, an application can use uname to check for the value of os_provider; if it equals ``SCO'', then the system supports the UDK. For example:
if [ `PATH=/udk/bin:$PATH uname os_provider 2>/dev/null` = Caldera ] then echo "UDK environment present." fi
From a C program, the confstr(3C) function is used instead:
confstr(_CS_OS_PROVIDER)
If the return value equals ``SCO'', then the system supports the UDK.
Additionally, there are some UnixWare 7 features that are supported on SCO UnixWare 2.1.X and UnixWare 7, but not SCO OpenServer Release 5. Applications that want to take advantage of a UnixWare-only feature can test to see if they are running on UnixWare by using:
uname sysnamein a shell script, or
confstr(_CS_SYSNAME)in a C program, and see if it equals ``UnixWare''. If so, the application is on SCO UnixWare 2.1.X (with the BCM installed), or UnixWare 7; if not, the application is running on SCO OpenServer (with the BCM installed).
Note that all the above commands and function calls would fail on an SCO OpenServer system without the UDK installed.
uname -- new and legacy parameters/values
new-style
parameter | -X name | legacy option | confstr | native OSR5 | native UW2 |
---|---|---|---|---|---|
architecture | _CS_ARCHITECTURE | x86at | |||
bus_types | BusType | _CS_BUSTYPES |
MCA
EISA ISA AT |
MCA
EISA ISA AT | |
hostname | Node | -n | _CS_HOSTNAME | local hostname | local hostname |
hw_provider |
-p
-c | _CS_HW_PROVIDER | i386 |
Caldera
x86at | |
hw_serial | Serial | -i | _CS_HW_SERIAL | OS serial # | |
kernel_stamp | KernelID | _CS_KERNEL_STAMP | yy/mm/dd | yy/mm/dd | |
machine | Machine | -m | _CS_MACHINE | i386 | i386 |
num_cpu | NumCPU | #CPUs | 1 | ||
os_base | _CS_OS_BASE | ||||
os_provider | _CS_OS_PROVIDER | ||||
release | Release | -r | _CS_RELEASE | 3.2 | 4.2MP |
srpc_domain | -d | _CS_SRPC_DOMAIN | |||
sysname | System | -s | _CS_SYSNAME | SCO_SV | UNIX_SV |
user_limit | Users |
-A
-l | _CS_USER_LIMIT |
nnn-user
nnnnnnnn unlim | |
version | -v | _CS_VERSION | 2 | 2.x |
UDK uname -- parameters and values on Caldera platforms
new-style
parameter | UnixWare 7 | UDK on OSR5 | UDK on UW2 | notes |
---|---|---|---|---|
architecture | IA32 | IA32 | IA32 | 13 |
bus_types |
comma list of:
EISA ISA MCA PCIm.n PnPm.n |
MCA
EISA ISA AT |
MCA
EISA ISA AT | 9,16 |
hostname | fully-qualified hostname | fully-qualified hostname | fully-qual hostname | 12 |
hw_provider |
Generic AT
Generic MP Compaq Proliant Compaq SystemPro DG NUMALiiNE ... |
Generic AT
Generic MP |
Generic AT
Generic MP! | 13,15 |
hw_serial | HW serial # | OS serial # | 4,7,8 | |
kernel_stamp | yy/mm/dd | yy/mm/dd | yy/mm/dd | 9 |
machine |
486
Pentium Pentium Pro Pentium II 5x86 6x86 Am5x86 AMD-K5 AMD-K6 |
386
486 Pentium Pentium Pro Pentium II 5x86 6x86 Am5x86 AMD-K5 AMD-K6 |
386
486 Pentium Pentium Pro Pentium II 5x86 6x86 Am5x86 AMD-K5 AMD-K6 | 2,11 |
num_cpu | #CPUs | #CPUs | #CPUs | 3 |
os_base | UNIX_SVR5 | UNIX_SVR3 | UNIX_SVR4 | 9 |
os_provider | SCO | SCO | SCO | 9 |
release | 5 | 3.2 | 4.2MP | 10 |
srpc_domain | 15 | |||
sysname | UnixWare | SCO_SV | UnixWare | 5 |
user_limit |
#users
unlimited |
#users
unlimited |
#users
unlimited | 1,6,9 |
version |
7
7.0.1 7.1.0 7.1.1 | 5.0.x | 2.x | 10,14 |
The columns in the table are interpreted as follows:
The notes column refers to the following numbered notes: