xref: /titanic_41/usr/src/cmd/truss/proto.h (revision 29949e866e40b95795203f3ee46f44a197c946e4)
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 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 
31 #ifndef	_PROTO_H
32 #define	_PROTO_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #include <sys/procset.h>
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 /* avoid a bit of stdio locking */
43 #define	fputc	putc_unlocked
44 
45 /* force (via setvbuf()) a reasonably large output file buffer size */
46 #define	MYBUFSIZ	8192
47 
48 /*
49  * Function prototypes for most external functions.
50  */
51 
52 extern	private_t *get_private(void);
53 extern	void	*my_malloc(size_t, const char *);
54 extern	void	*my_realloc(void *, size_t, const char *);
55 extern	void	*my_calloc(size_t, size_t, const char *);
56 extern	void	make_pname(private_t *, id_t);
57 extern	int	requested(private_t *, int, int);
58 extern	int	jobcontrol(private_t *, int);
59 extern	int	signalled(private_t *, int, int);
60 extern	int	faulted(private_t *, int);
61 extern	int	sysentry(private_t *, int);
62 extern	int	sysexit(private_t *, int);
63 extern	void	showbuffer(private_t *, long, long);
64 extern	void	showbytes(const char *, int, char *);
65 extern	void	accumulate(timestruc_t *,
66 			const timestruc_t *, const timestruc_t *);
67 
68 extern	const char *ioctlname(private_t *, uint_t);
69 extern	const char *ioctldatastruct(uint_t);
70 extern	const char *fcntlname(int);
71 extern	const char *sfsname(int);
72 extern	const char *plockname(int);
73 extern	const char *si86name(int);
74 extern	const char *utscode(int);
75 extern	const char *sigarg(private_t *, int);
76 extern	const char *openarg(private_t *, int);
77 extern	const char *whencearg(int);
78 extern	const char *msgflags(private_t *, int);
79 extern	const char *semflags(private_t *, int);
80 extern	const char *shmflags(private_t *, int);
81 extern	const char *msgcmd(int);
82 extern	const char *semcmd(int);
83 extern	const char *shmcmd(int);
84 extern	const char *strrdopt(int);
85 extern	const char *strevents(private_t *, int);
86 extern	const char *tiocflush(private_t *, int);
87 extern	const char *strflush(int);
88 extern	const char *mountflags(private_t *, int);
89 extern	const char *svfsflags(private_t *, ulong_t);
90 extern	const char *sconfname(int);
91 extern	const char *pathconfname(int);
92 extern	const char *fuiname(int);
93 extern	const char *fuflags(private_t *, int);
94 extern	const char *ipprotos(int);
95 
96 extern	void	expound(private_t *, long, int);
97 extern	void	prtimestruc(private_t *, const char *, timestruc_t *);
98 extern	void	print_siginfo(private_t *, const siginfo_t *);
99 
100 extern	void	Flush(void);
101 extern	void	Eserialize(void);
102 extern	void	Xserialize(void);
103 extern	void	procadd(pid_t, const char *lwplist);
104 extern	int	lwptrace(pid_t, lwpid_t);
105 extern	void	procdel(void);
106 extern	int	checkproc(private_t *);
107 
108 extern	int	syslist(char *, sysset_t *, int *);
109 extern	int	siglist(private_t *, char *, sigset_t *, int *);
110 extern	int	fltlist(char *, fltset_t *, int *);
111 extern	int	fdlist(char *, fileset_t *);
112 extern	int	liblist(char *, int);
113 
114 extern	char 	*fetchstring(private_t *, long, int);
115 extern	void	show_cred(private_t *, int);
116 extern	void	errmsg(const char *, const char *);
117 extern	void	abend(const char *, const char *);
118 
119 extern	void	outstring(private_t *, const char *);
120 extern	void	grow(private_t *, int);
121 
122 extern	void	show_procset(private_t *, long);
123 extern	const char *idtype_enum(private_t *, long);
124 extern	const char *woptions(private_t *, int);
125 
126 extern	void	putpname(private_t *);
127 extern	void	timestamp(private_t *);
128 
129 extern	const char *errname(int);
130 extern	const char *sysname(private_t *, int, int);
131 extern	const char *rawsigname(private_t *, int);
132 extern	const char *signame(private_t *, int);
133 
134 extern	int	getsubcode(private_t *);
135 extern	int	maxsyscalls(void);
136 extern	int	nsubcodes(int);
137 
138 extern	void	show_stat(private_t *, long);
139 extern	void	show_statat(private_t *, long);
140 extern	void	show_xstat(private_t *, int, long);
141 extern	void	show_stat64_32(private_t *, long);
142 
143 extern	void	establish_breakpoints(void);
144 extern	void	establish_stacks(void);
145 extern	void	reset_breakpoints(void);
146 extern	void	clear_breakpoints(void);
147 extern	int	function_trace(private_t *, int, int, int);
148 extern	void	reestablish_traps(void);
149 extern	void	report_htable_stats(void);
150 
151 extern	const char *door_flags(private_t *, long);
152 extern	void	prt_ffg(private_t *, int, long);
153 extern	void	escape_string(private_t *, const char *);
154 
155 #ifdef	__cplusplus
156 }
157 #endif
158 
159 #endif	/* _PROTO_H */
160