1kstat_chain_update(3KSTKAeTr)nel Statistics Library Functkisotnast_chain_update(3KSTAT)
2
3
4

NAME

6       kstat_chain_update - update the kstat header chain
7

SYNOPSIS

9       cc [ flag... ] file... -lkstat [ library...]
10       #include <kstat.h>
11
12
13
14       kid_t kstat_chain_update(kstat_ctl_t *kc);
15
16

DESCRIPTION

18       The  kstat_chain_update() function brings the user's kstat header chain
19       in sync with that of the kernel. The kstat chain is a  linked  list  of
20       kstat  headers   (kstat_t's)  pointed to by kc->kc_chain, which is ini‐
21       tialized by kstat_open(3KSTAT). This chain constitutes a  list  of  all
22       kstats currently in the system.
23
24
25       During  normal  operation, the kernel creates new kstats and delete old
26       ones as various device instances are added and removed, thereby causing
27       the  user's  copy  of  the  kstat  chain  to  become  out  of date. The
28       kstat_chain_update() function detects this condition by  comparing  the
29       kernel's current kstat chain ID (KCID), which is incremented every time
30       the kstat chain changes, to the user's KCID,  kc->kc_chain_id.  If  the
31       KCIDs  match, kstat_chain_update() does nothing.  Otherwise, it deletes
32       any invalid kstat headers from the user's kstat  chain,  adds  any  new
33       ones, and sets kc->kc_chain_id to the new KCID. All other kstat headers
34       in the user's kstat chain are unmodified.
35

RETURN VALUES

37       Upon successful completion, kstat_chain_update() returns the  new  KCID
38       if  the kstat chain has changed and 0 if it has not changed. Otherwise,
39       it returns −1 and sets errno to indicate the error.
40

ERRORS

42       The kstat_chain_update() function will fail if:
43
44       EAGAIN       The kstat was temporarily unavailable for reading or writ‐
45                    ing.
46
47
48       ENOMEM       Insufficient storage space is available.
49
50
51       ENXIO        The given kstat could not be located for reading.
52
53
54       EOVERFLOW    The data for the given kstat was too large to be stored in
55                    the structure.
56
57

FILES

59       /dev/kstat    kernel statistics driver
60
61

ATTRIBUTES

63       See attributes(5) for descriptions of the following attributes:
64
65
66
67
68       ┌─────────────────────────────┬─────────────────────────────┐
69       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
70       ├─────────────────────────────┼─────────────────────────────┤
71       │Interface Stability          │Stable                       │
72       ├─────────────────────────────┼─────────────────────────────┤
73       │MT-Level                     │Unsafe                       │
74       └─────────────────────────────┴─────────────────────────────┘
75

SEE ALSO

77       kstat(3KSTAT),        kstat_lookup(3KSTAT),         kstat_open(3KSTAT),
78       kstat_read(3KSTAT), attributes(5)
79
80
81
82SunOS 5.11                        3 Aug 2004        kstat_chain_update(3KSTAT)
Impressum