FreeBSD/Linux Kernel Cross Reference
sys/man/host_info.man
1 .\"
2 .\" Mach Operating System
3 .\" Copyright (c) 1991,1990 Carnegie Mellon University
4 .\" All Rights Reserved.
5 .\"
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
11 .\"
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 .\"
16 .\" Carnegie Mellon requests users of this software to return to
17 .\"
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
22 .\"
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"
26 .\"
27 .\" HISTORY
28 .\" $Log: host_info.man,v $
29 .\" Revision 2.5 93/03/18 15:13:55 mrt
30 .\" corrected types
31 .\" [93/03/12 16:51:26 lli]
32 .\"
33 .\" Revision 2.4 91/05/14 17:04:34 mrt
34 .\" Correcting copyright
35 .\"
36 .\" Revision 2.3 91/02/14 14:10:15 mrt
37 .\" Changed to new Mach copyright
38 .\" [91/02/12 18:10:19 mrt]
39 .\"
40 .\" Revision 2.2 90/08/07 18:34:29 rpd
41 .\" Created.
42 .\"
43 .\"
44 .TH host_info 2 8/13/89
45 .CM 4
46 .SH NAME
47 .nf
48 host_info \- gets information about host
49 .SH SYNOPSIS
50 .nf
51 .ft B
52 #include <mach.h>
53
54 /* the definition of host_info_t from mach.h - sys/host_info.h is */
55
56 typedef int *host_info_t; /* variable length array of int */
57
58 /* two interpretations of info are: */
59
60 struct host_basic_info {
61 int max_cpus; /* maximum possible cpus for
62 which kernel is configured */
63 int avail_cpus; /* number of cpus now available */
64 vm_size_t memory_size; /* size of memory in bytes */
65 cpu_type_t cpu_type; /* cpu type */
66 cpu_subtype_t cpu_subtype; /* cpu subtype */
67 };
68 typedef struct host_basic_info *host_basic_info_t;
69
70
71 struct host_sched_info {
72 int min_timeout; /* minimum timeout in milliseconds */
73 int min_quantum; /* minimum quantum in milliseconds */
74 };
75 typedef struct host_sched_info *host_sched_info_t
76
77
78 .nf
79 .ft B
80 kern_return_t host_info(host, flavor, host_info, host_infoCnt)
81 mach_port_t host;
82 int flavor;
83 host_info_t host_info; /* in and out */
84 mach_msg_type_number_t *host_infoCnt; /* in and out */
85
86
87 .fi
88 .ft P
89 .SH ARGUMENTS
90 .TP 15
91 .B
92 host
93 The host for which information is to be obtained
94 .TP 15
95 .B
96 flavor
97 The type of statistics that are wanted. Currently
98 .B HOST_BASIC_INFO, HOST_PROCESSOR_SLOTS,
99 and
100 .B HOST_SCHED_INFO
101 are implemented.
102 .TP 15
103 .B
104 host_info
105 Statistics about the host specified by
106 .B host.
107 .TP 15
108 .B
109 host_infoCnt
110 Size of the info structure. Should be
111 .B HOST_BASIC_INFO_COUNT
112 for
113 .B HOST_BASIC_INFO.
114 Should be the max number of cpus returned by
115 .B HOST_BASIC_INFO
116 for
117 .B HOST_PROCESSOR_SLOTS.
118 Should be
119 .B HOST_SCHED_INFO_COUNT
120 for
121 .B HOST_SCHED_INFO.
122
123 .SH DESCRIPTION
124
125 Returns the selected information array for a host, as specified
126 by
127 .B flavor.
128
129 .B host_info
130 is an array of integers that is supplied
131 by the caller, and filled with specified information.
132 .B host_infoCnt
133 is supplied as the maximum number of integers in
134 .B host_info.
135 On return, it contains the actual number of integers in
136 .B host_info.
137
138 Basic information is defined by
139 .B HOST_BASIC_INFO.
140 The size of this information is defined by
141 .B HOST_BASIC_INFO_COUNT.
142 Processor slots of the active (available) processors is defined by
143 .B HOST_PROCESSOR_SLOTS.
144 The size of this information should be obtained from the
145 .B max_cpus
146 field of the structure returned by
147 .B HOST_BASIC_INFO.
148 Additional information of interest to schedulers is defined by
149 .B HOST_SCHED_INFO.
150 The size of this information is defined by
151 .B HOST_SCHED_INFO_COUNT.
152
153 .SH DIAGNOSTICS
154 .TP 25
155 KERN_SUCCESS
156 The call succeeded.
157 .TP 25
158 KERN_INVALID_ARGUMENT
159 .B host
160 is not a host or
161 .B flavor
162 is not recognized.
163 .TP 25
164 MIG_ARRAY_TOO_LARGE
165 Returned info array is too large for
166 .B host_info.
167
168 .B host_info
169 is filled as much as possible.
170 .B host_infoCnt
171 is set to the number of elements that would
172 be returned if there were enough room.
173
174 .SH BUGS
175 Availability limited. Systems without this call support a host_info
176 call with an incompatible calling sequence.
177
178 .SH SEE ALSO
179 .B host_ports, host_kernel_version, host_processors, processor_info
180
Cache object: 29c5e3a2782e794d86ed52ff488e0701
|