2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright (c) 2015, Joyent, Inc. 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. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
5 .\" See the License for the specific language governing permissions and limitations under the License. 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
6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH SYSEVENT_GET_VENDOR_NAME 3SYSEVENT "Jun 29, 2015"
9 sysevent_get_vendor_name, sysevent_get_pub_name, sysevent_get_pid \- get vendor
10 name, publisher name or processor ID of event
14 \fBcc \fR [\fIflag \&.\|.\|.\fR] \fIfile\fR\&.\|.\|. \fB-lsysevent\fR [\fIlibrary \&.\|.\|.\fR]
15 #include <libsysevent.h>
17 \fBchar *\fR\fBsysevent_get_vendor_name\fR(\fBsysevent_t *\fR\fIev\fR);
22 \fBchar *\fR\fBsysevent_get_pub_name\fR(\fBsysevent_t *\fR\fIev\fR);
27 \fBvoid\fR \fBsysevent_get_pid\fR(\fBsysevent_t *\fR\fIev\fR, \fBpid_t *\fR\fIpid\fR);
36 handle to a system event object
41 The \fBsysevent_get_pub_name()\fR function returns the publisher name for the
42 sysevent handle, \fIev\fR. The publisher name identifies the name of the
43 publishing application or kernel subsystem of the sysevent.
46 The \fBsysevent_get_pid()\fR function sets the process ID \fIpid\fR to that of
47 the publishing application or \fBSE_KERN_PID\fR for sysevents originating in the
48 kernel. The publisher name and PID are useful for implementing event
52 The \fBsysevent_get_vendor_name()\fR function returns the vendor string for the
53 publishing application or kernel subsystem. A vendor string is the company's
54 stock symbol that provided the application or kernel subsystem that generated
55 the system event. This information is useful for filtering sysevents for one
59 The interface manages the allocation of the vendor and publisher name strings,
60 but it is the caller's responsibility to free the strings when they are no
61 longer needed by calling \fBfree\fR(3MALLOC). If the new vendor and publisher
62 name strings cannot be created, \fBsysevent_get_vendor_name()\fR and
63 \fBsysevent_get_pub_name()\fR return a null pointer and may set errno to
64 \fBENOMEM\fR to indicate that the storage space available is insufficient.
67 \fBExample 1 \fRParse sysevent header information.
70 The following example parses sysevent header information from an application's
81 event_handler(sysevent_t *ev)
83 if (strcmp(EC_PRIV, sysevent_get_class_name(ev)) != 0) {
87 vendor = sysevent_get_vendor_name(ev);
88 if (strcmp("SUNW", vendor) != 0) {
92 pub = sysevent_get_pub_name(ev);
93 if (strcmp("test_daemon", pub) != 0) {
98 sysevent_get_pid(ev, &pid);
99 (void) kill(pid, SIGUSR1);
109 See \fBattributes\fR(5) for descriptions of the following attributes:
117 ATTRIBUTE TYPE ATTRIBUTE VALUE
119 Interface Stability Committed
126 \fBmalloc\fR(3MALLOC), \fBattributes\fR(5)
129 The \fBlibsysevent\fR interfaces do not work at all in non-global zones.