1sysevent_get_vendor_name(S3ySsYtSeEmVEENvTe)nt LibrarysyFsuenvcetnito_ngset_vendor_name(3SYSEVENT)
2
3
4

NAME

6       sysevent_get_vendor_name, sysevent_get_pub_name, sysevent_get_pid - get
7       vendor name, publisher name or processor ID of event
8

SYNOPSIS

10       cc  [flag ...]  file... -lsysevent [library ...]
11       #include <libsysevent.h>
12
13       char *sysevent_get_vendor_name(sysevent_t *ev);
14
15
16       char *sysevent_get_pub_name(sysevent_t *ev);
17
18
19       pid_t sysevent_get_pid(sysevent_t *ev);
20
21

PARAMETERS

23       ev    handle to a system event object
24
25

DESCRIPTION

27       The sysevent_get_pub_name() function returns the publisher name for the
28       sysevent  handle,  ev.   The  publisher name identifies the name of the
29       publishing application or kernel subsystem of the sysevent.
30
31
32       The sysevent_get_pid() function returns the process ID for the publish‐
33       ing application or SE_KERN_PID for sysevents originating in the kernel.
34       The publisher name and PID are useful for implementing  event  acknowl‐
35       edgement.
36
37
38       The  sysevent_get_vendor_name()  function returns the vendor string for
39       the publishing application or kernel subsystem.  A vendor string is the
40       company's  stock symbol that provided the application or kernel subsys‐
41       tem that generated the system event.  This information  is  useful  for
42       filtering sysevents for one or more vendors.
43
44
45       The  interface  manages the allocation of the vendor and publisher name
46       strings, but it is the caller's responsibility to free the strings when
47       they  are  no longer needed by calling free(3MALLOC). If the new vendor
48       and  publisher  name  strings  cannot  be  created,   sysevent_get_ven‐
49       dor_name()  and  sysevent_get_pub_name()  return a null pointer and may
50       set errno to ENOMEM to indicate that the  storage  space  available  is
51       insufficient.
52

EXAMPLES

54       Example 1 Parse sysevent header information.
55
56
57       The following example parses sysevent header information from an appli‐
58       cation's event handler.
59
60
61         char *vendor;
62         char *pub;
63
64         void
65         event_handler(sysevent_t *ev)
66         {
67                 if (strcmp(EC_PRIV, sysevent_get_class_name(ev)) != 0) {
68                         return;
69                 }
70
71                 vendor = sysevent_get_vendor_name(ev);
72                 if (strcmp("SUNW", vendor) != 0) {
73                         free(vendor);
74                         return;
75                 }
76                 pub = sysevent_get_pub_name(ev);
77                 if (strcmp("test_daemon", pub) != 0) {
78                         free(vendor);
79                         free(pub);
80                         return;
81                 }
82                 (void) kill(sysevent_get_pid(ev), SIGUSR1);
83                 free(vendor);
84                 free(pub);
85         }
86
87

ATTRIBUTES

89       See attributes(5) for descriptions of the following attributes:
90
91
92
93
94       ┌─────────────────────────────┬─────────────────────────────┐
95       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
96       ├─────────────────────────────┼─────────────────────────────┤
97       │Interface Stability          │Committed                    │
98       ├─────────────────────────────┼─────────────────────────────┤
99       │MT-Level                     │MT-Safe                      │
100       └─────────────────────────────┴─────────────────────────────┘
101

SEE ALSO

103       malloc(3MALLOC), attributes(5)
104

NOTES

106       The libsysevent interfaces do not work at all in non-global zones.
107
108
109
110SunOS 5.11                        24 Jul 200s9ysevent_get_vendor_name(3SYSEVENT)
Impressum