Gets information about the system you are using.
Compatibility:This function is compatible with the following targets:
|
ANSI
|
BeOS
|
EMB/RTOS
|
|
#include <utsname.h>
int uname(struct utsname *name);Parameters:
Parameters for this facility are:
This function gets information on the Macintosh you're using and puts the information in the structure that name points to. The structure contains the fields listed in Table 33.1. All the fields are null-terminated strings.
|
This field
|
is
|
|---|---|
#include <stdio.h>
#include <utsname.h>
int main(void)
{
struct utsname name;
uname(&name);
printf("Operating System: %s\n", name.sysname);
printf("Node Name: %s\n", name.nodename);
printf("Release: %s\n", name.release);
printf("Version: %s\n", name.version);
printf("Machine: %s\n", name.machine);
return 0;
}
This application could print the following:
Operating System: MacOS
Node Name: Ron's G4
Release: 9
Version: 3
Machine: Power Macintosh
This machine is a Power Macintosh running Version 9 of the MacOS. The Macintosh Name field of the File Sharing control panel contains "Ron's G4"
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000