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