1cpc_version(3CPC) CPU Performance Counters Library Functions cpc_version(3CPC)
2
3
4

NAME

6       cpc_version - coordinate CPC library and application versions
7

SYNOPSIS

9       cc [ flag... ] file... −lcpc [ library... ]
10       #include <libcpc.h>
11
12       uint_t cpc_version(uint_t version);
13
14

DESCRIPTION

16       The  cpc_version()  function  takes an interface version as an argument
17       and returns an interface version as a result.   Usually,  the  argument
18       will  be  the value of CPC_VER_CURRENT bound to the application when it
19       was compiled.
20

RETURN VALUES

22       If the version requested is  still  supported  by  the  implementation,
23       cpc_version()  returns the requested version number and the application
24       can use the facilities of the library on that platform.  If the  imple‐
25       mentation  cannot  support  the  version  needed  by  the  application,
26       cpc_version() returns CPC_VER_NONE,  indicating  that  the  application
27       will  at  least  need  to be recompiled to operate correctly on the new
28       platform, and may require further changes.
29
30
31       If version is CPC_VER_NONE, cpc_version() returns the most current ver‐
32       sion of the library.
33

EXAMPLES

35       Example 1  Protect an application from using an incompatible library.
36
37
38       The following lines of code protect an application from using an incom‐
39       patible library:
40
41
42         if (cpc_version(CPC_VER_CURRENT) == CPC_VER_NONE) {
43                 /* version mismatch - library cannot translate */
44                 exit(1);
45         }
46
47

ATTRIBUTES

49       See attributes(5) for descriptions of the following attributes:
50
51
52
53
54       ┌─────────────────────────────┬─────────────────────────────┐
55       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
56       ├─────────────────────────────┼─────────────────────────────┤
57       │Interface Stability          │Evolving                     │
58       ├─────────────────────────────┼─────────────────────────────┤
59       │MT-Level                     │Unsafe                       │
60       └─────────────────────────────┴─────────────────────────────┘
61

SEE ALSO

63       cpc(3CPC), cpc_open(3CPC), libcpc(3LIB), attributes(5)
64

NOTES

66       The cpc_version() function exists for binary compatibility only. Source
67       containing  this  function  will not compile. This function is obsolete
68       and might be removed in  a  future  release.  Applications  should  use
69       cpc_open(3CPC) instead.
70
71
72       The  version  number  is  used  only  to  express incompatible semantic
73       changes in the performance counter interfaces  on  the  given  platform
74       within  a  single instruction set architecture, for example, when a new
75       set of performance counter registers are added to  an existing  proces‐
76       sor  family  that  cannot be specified in the existing cpc_event_t data
77       structure.
78
79
80
81SunOS 5.11                        28 Mar 2005                cpc_version(3CPC)
Impressum