xref: /titanic_50/usr/src/cmd/truss/proto.h (revision 29e83d4b25fd82feb8e0e0fbe89f7e2a8438533d)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
27 /*	  All Rights Reserved  	*/
28 
29 
30 #ifndef	_PROTO_H
31 #define	_PROTO_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #include <sys/procset.h>
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 /* avoid a bit of stdio locking */
42 #define	fputc	putc_unlocked
43 
44 /* force (via setvbuf()) a reasonably large output file buffer size */
45 #define	MYBUFSIZ	8192
46 
47 /*
48  * Function prototypes for most external functions.
49  */
50 
51 extern	private_t *get_private(void);
52 extern	void	*my_malloc(size_t, const char *);
53 extern	void	*my_realloc(void *, size_t, const char *);
54 extern	void	*my_calloc(size_t, size_t, const char *);
55 extern	void	make_pname(private_t *, id_t);
56 extern	int	requested(private_t *, int, int);
57 extern	int	jobcontrol(private_t *, int);
58 extern	int	signalled(private_t *, int, int);
59 extern	int	faulted(private_t *, int);
60 extern	int	sysentry(private_t *, int);
61 extern	int	sysexit(private_t *, int);
62 extern	void	showbuffer(private_t *, long, long);
63 extern	void	showbytes(const char *, int, char *);
64 extern	void	accumulate(timestruc_t *,
65 			const timestruc_t *, const timestruc_t *);
66 
67 extern	const char *ioctlname(private_t *, uint_t);
68 extern	const char *ioctldatastruct(uint_t);
69 extern	const char *fcntlname(int);
70 extern	const char *sfsname(int);
71 extern	const char *plockname(int);
72 extern	const char *si86name(int);
73 extern	const char *utscode(int);
74 extern	const char *sigarg(private_t *, int);
75 extern	const char *openarg(private_t *, int);
76 extern	const char *whencearg(int);
77 extern	const char *msgflags(private_t *, int);
78 extern	const char *semflags(private_t *, int);
79 extern	const char *shmflags(private_t *, int);
80 extern	const char *msgcmd(int);
81 extern	const char *semcmd(int);
82 extern	const char *shmcmd(int);
83 extern	const char *strrdopt(int);
84 extern	const char *strevents(private_t *, int);
85 extern	const char *tiocflush(private_t *, int);
86 extern	const char *strflush(int);
87 extern	const char *mountflags(private_t *, int);
88 extern	const char *svfsflags(private_t *, ulong_t);
89 extern	const char *sconfname(int);
90 extern	const char *pathconfname(int);
91 extern	const char *fuiname(int);
92 extern	const char *fuflags(private_t *, int);
93 extern	const char *ipprotos(int);
94 extern	const char *rctlsyscode(int);
95 extern	const char *rctl_local_flags(private_t *, uint_t val);
96 extern	const char *rctl_local_action(private_t *, uint_t val);
97 
98 extern	void	expound(private_t *, long, int);
99 extern	void	prtimestruc(private_t *, const char *, timestruc_t *);
100 extern	void	print_siginfo(private_t *, const siginfo_t *);
101 
102 extern	void	Flush(void);
103 extern	void	Eserialize(void);
104 extern	void	Xserialize(void);
105 extern	void	procadd(pid_t, const char *lwplist);
106 extern	int	lwptrace(pid_t, lwpid_t);
107 extern	void	procdel(void);
108 extern	int	checkproc(private_t *);
109 
110 extern	int	syslist(char *, sysset_t *, int *);
111 extern	int	siglist(private_t *, char *, sigset_t *, int *);
112 extern	int	fltlist(char *, fltset_t *, int *);
113 extern	int	fdlist(char *, fileset_t *);
114 extern	int	liblist(char *, int);
115 
116 extern	char 	*fetchstring(private_t *, long, int);
117 extern	void	show_cred(private_t *, int);
118 extern	void	errmsg(const char *, const char *);
119 extern	void	abend(const char *, const char *);
120 
121 extern	void	outstring(private_t *, const char *);
122 extern	void	grow(private_t *, int);
123 
124 extern	void	show_procset(private_t *, long);
125 extern	const char *idtype_enum(private_t *, long);
126 extern	const char *woptions(private_t *, int);
127 
128 extern	void	putpname(private_t *);
129 extern	void	timestamp(private_t *);
130 
131 extern	const char *errname(int);
132 extern	const char *sysname(private_t *, int, int);
133 extern	const char *rawsigname(private_t *, int);
134 extern	const char *signame(private_t *, int);
135 
136 extern	int	getsubcode(private_t *);
137 extern	int	maxsyscalls(void);
138 extern	int	nsubcodes(int);
139 
140 extern	void	show_stat(private_t *, long);
141 extern	void	show_statat(private_t *, long);
142 extern	void	show_xstat(private_t *, int, long);
143 extern	void	show_stat64_32(private_t *, long);
144 
145 extern	void	establish_breakpoints(void);
146 extern	void	establish_stacks(void);
147 extern	void	reset_breakpoints(void);
148 extern	void	clear_breakpoints(void);
149 extern	int	function_trace(private_t *, int, int, int);
150 extern	void	reestablish_traps(void);
151 extern	void	report_htable_stats(void);
152 
153 extern	const char *door_flags(private_t *, long);
154 extern	void	prt_ffg(private_t *, int, long);
155 extern	void	escape_string(private_t *, const char *);
156 
157 #ifdef	__cplusplus
158 }
159 #endif
160 
161 #endif	/* _PROTO_H */
162