9070 Remove wanboot from gate
[unleashed.git] / usr / src / man / man3cpc / cpc_access.3cpc
blob1579905f9a4fb5d069bc758eaf762bb7a2895784
1 '\" te
2 .\" Copyright (c) 2005, Sun Microsystems, Inc.
3 .\" All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH CPC_ACCESS 3CPC "Mar 28, 2005"
8 .SH NAME
9 cpc_access \- test access CPU performance counters
10 .SH SYNOPSIS
11 .LP
12 .nf
13 cc [ \fIflag\fR... ] \fIfile\fR... \(milcpc [ \fIlibrary\fR... ]
14 #include <libcpc.h>
16 \fBint\fR \fBcpc_access\fR(\fBvoid\fR);
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 Access to CPU performance counters is possible only on systems where the
23 appropriate hardware exists and is correctly configured. The \fBcpc_access()\fR
24 function \fBmust\fR be used to determine if the hardware exists and is
25 accessible on the platform before any of the interfaces that use the counters
26 are invoked.
27 .sp
28 .LP
29 When the hardware is available, access to the per-process counters is always
30 allowed to the process itself, and allowed to other processes mediated using
31 the existing security mechanisms of \fB/proc\fR.
32 .SH RETURN VALUES
33 .sp
34 .LP
35 Upon successful completion, \fBcpc_access()\fR returns \fB0\fR.  Otherwise, it
36 returns \fB\(mi1\fR and sets \fBerrno\fR to indicate the error.
37 .sp
38 .LP
39 By default, two common \fBerrno\fR values are decoded and cause the library to
40 print an error message using its reporting mechanism. See
41 \fBcpc_seterrfn\fR(3CPC) for a description of how this behavior can be
42 modified.
43 .SH ERRORS
44 .sp
45 .LP
46 The \fBcpc_access()\fR function will fail if:
47 .sp
48 .ne 2
49 .na
50 \fB\fBEAGAIN\fR\fR
51 .ad
52 .RS 10n
53 Another process may be sampling system-wide CPU statistics.
54 .RE
56 .sp
57 .ne 2
58 .na
59 \fB\fBENOSYS\fR\fR
60 .ad
61 .RS 10n
62 CPU performance counters are inaccessible on this machine. This error can occur
63 when the machine supports CPU performance counters, but some software
64 components are missing. Check to see that all CPU Performance Counter packages
65 have been correctly installed.
66 .RE
68 .SH ATTRIBUTES
69 .sp
70 .LP
71 See \fBattributes\fR(5) for descriptions of the following attributes:
72 .sp
74 .sp
75 .TS
76 box;
77 l | l
78 l | l .
79 ATTRIBUTE TYPE  ATTRIBUTE VALUE
81 MT-Level        MT-Safe
83 Interface Stability     Obsolete
84 .TE
86 .SH SEE ALSO
87 .sp
88 .LP
89 \fBcpc\fR(3CPC), \fBcpc_open\fR(3CPC), \fBcpc_seterrfn\fR(3CPC),
90 \fBlibcpc\fR(3LIB), \fBproc\fR(4), \fBattributes\fR(5)
91 .SH NOTES
92 .sp
93 .LP
94 The \fBcpc_access()\fR function exists for binary compatibility only. Source
95 containing this function will not compile. This function is obsolete and might
96 be removed in a future release. Applications should use \fBcpc_open\fR(3CPC)
97 instead.