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