xref: /illumos-gate/usr/src/cmd/saf/global.c (revision 533affcbc7fc4d0c8132976ea454aaa715fe2307)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 #ident	"%Z%%M%	%I%	%E% SMI"       /* SVr4.0 1.7*/
27 
28 
29 # include <stdio.h>
30 # include <sac.h>
31 # include <sys/types.h>
32 # include "misc.h"
33 # include "structs.h"
34 
35 /*
36  * possible error messages that can be generated by the sac
37  */
38 
39 struct errmsg Msgs[] = {
40 	"could not open _sactab", 1,		/* E_SACOPEN */
41 	"malloc failed", 2,			/* E_MALLOC */
42 	"_sactab file is corrupt", 3,		/* E_BADFILE */
43 	"_sactab version # is incorrect", 4,	/* E_BADVER */
44 	"can not chdir to home directory", 5,	/* E_CHDIR */
45 	"could not open _sacpipe", 6,		/* E_NOPIPE */
46 	"internal error - bad state", 7,	/* E_BADSTATE */
47 	"read of _sacpipe failed", 8,		/* E_BADREAD */
48 	"fattach failed", 9,		 	/* E_FATTACH */
49 	"I_SETSIG failed", 10,		 	/* E_SETSIG */
50 	"read failed", 11,			/* E_READ */
51 	"poll failed", 12,			/* E_POLL */
52 	"system error in _sysconfig", 13,	/* E_SYSCONF */
53 	"error interpreting _sysconfig", 14,	/* E_BADSYSCONF */
54 	"pipe failed", 15,			/* E_PIPE */
55 	"could not create _cmdpipe", 16,	/* E_CMDPIPE */
56 };
57 
58 int	N_msgs = sizeof(Msgs) / sizeof(struct errmsg);	/* number of valid messages */
59 int	Stime;			/* sanity timer interval */
60 struct	sactab	*Sactab;	/* linked list head of PM info */
61 char	Scratch[SIZE];		/* general scratch buffer */
62 int	Sfd;			/* _sacpipe file descriptor */
63 int	Cfd;			/* command pipe file descriptor */
64 int	Nentries;		/* # of entries in internal version of _sactab */
65