xref: /titanic_41/usr/src/cmd/truss/proto.h (revision 35a5a3587fd94b666239c157d3722745250ccbd7)
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 2009 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 *plockname(int);
70 extern	const char *si86name(int);
71 extern	const char *utscode(int);
72 extern	const char *openarg(private_t *, int);
73 extern	const char *whencearg(int);
74 extern	const char *msgflags(private_t *, int);
75 extern	const char *semflags(private_t *, int);
76 extern	const char *shmflags(private_t *, int);
77 extern	const char *msgcmd(int);
78 extern	const char *semcmd(int);
79 extern	const char *shmcmd(int);
80 extern	const char *strrdopt(int);
81 extern	const char *strevents(private_t *, int);
82 extern	const char *tiocflush(private_t *, int);
83 extern	const char *strflush(int);
84 extern	const char *mountflags(private_t *, int);
85 extern	const char *svfsflags(private_t *, ulong_t);
86 extern	const char *sconfname(int);
87 extern	const char *pathconfname(int);
88 extern	const char *fuiname(int);
89 extern	const char *fuflags(private_t *, int);
90 extern	const char *ipprotos(int);
91 extern	const char *rctlsyscode(int);
92 extern	const char *rctl_local_flags(private_t *, uint_t val);
93 extern	const char *rctl_local_action(private_t *, uint_t val);
94 
95 extern	void	expound(private_t *, long, int);
96 extern	void	prtimestruc(private_t *, const char *, timestruc_t *);
97 extern	void	print_siginfo(private_t *, const siginfo_t *);
98 
99 extern	void	Flush(void);
100 extern	void	Eserialize(void);
101 extern	void	Xserialize(void);
102 extern	void	procadd(pid_t, const char *lwplist);
103 extern	int	lwptrace(pid_t, lwpid_t);
104 extern	void	procdel(void);
105 extern	int	checkproc(private_t *);
106 
107 extern	int	syslist(char *, sysset_t *, int *);
108 extern	int	siglist(private_t *, char *, sigset_t *, int *);
109 extern	int	fltlist(char *, fltset_t *, int *);
110 extern	int	fdlist(char *, fileset_t *);
111 extern	int	liblist(char *, int);
112 
113 extern	char 	*fetchstring(private_t *, long, int);
114 extern	void	show_cred(private_t *, int);
115 extern	void	errmsg(const char *, const char *);
116 extern	void	abend(const char *, const char *);
117 
118 extern	void	outstring(private_t *, const char *);
119 extern	void	grow(private_t *, int);
120 
121 extern	void	show_procset(private_t *, long);
122 extern	const char *idtype_enum(private_t *, long);
123 extern	const char *woptions(private_t *, int);
124 
125 extern	void	putpname(private_t *);
126 extern	void	timestamp(private_t *);
127 
128 extern	const char *errname(int);
129 extern	const char *sysname(private_t *, int, int);
130 extern	const char *rawsigname(private_t *, int);
131 extern	const char *signame(private_t *, int);
132 
133 extern	int	getsubcode(private_t *);
134 extern	int	maxsyscalls(void);
135 extern	int	nsubcodes(int);
136 
137 extern	void	show_stat(private_t *, long);
138 extern	void	show_statat(private_t *, long);
139 extern	void	show_xstat(private_t *, int, long);
140 extern	void	show_stat64_32(private_t *, long);
141 
142 extern	void	establish_breakpoints(void);
143 extern	void	establish_stacks(void);
144 extern	void	reset_breakpoints(void);
145 extern	void	clear_breakpoints(void);
146 extern	int	function_trace(private_t *, int, int, int);
147 extern	void	reestablish_traps(void);
148 extern	void	report_htable_stats(void);
149 
150 extern	const char *door_flags(private_t *, long);
151 extern	void	prt_ffg(private_t *, int, long);
152 extern	void	escape_string(private_t *, const char *);
153 
154 #ifdef	__cplusplus
155 }
156 #endif
157 
158 #endif	/* _PROTO_H */
159