xref: /titanic_50/usr/src/cmd/truss/proto.h (revision 5403172acfed6a387c70d9cddbc195d9ba8c1e05)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5aa4a4f3bSnf202958  * Common Development and Distribution License (the "License").
6aa4a4f3bSnf202958  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21*5403172aSRoger A. Faulkner 
227c478bd9Sstevel@tonic-gate /*
23*5403172aSRoger A. Faulkner  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
287c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef	_PROTO_H
317c478bd9Sstevel@tonic-gate #define	_PROTO_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #include <sys/procset.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /* avoid a bit of stdio locking */
407c478bd9Sstevel@tonic-gate #define	fputc	putc_unlocked
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /* force (via setvbuf()) a reasonably large output file buffer size */
437c478bd9Sstevel@tonic-gate #define	MYBUFSIZ	8192
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate /*
467c478bd9Sstevel@tonic-gate  * Function prototypes for most external functions.
477c478bd9Sstevel@tonic-gate  */
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate extern	private_t *get_private(void);
507c478bd9Sstevel@tonic-gate extern	void	*my_malloc(size_t, const char *);
517c478bd9Sstevel@tonic-gate extern	void	*my_realloc(void *, size_t, const char *);
527c478bd9Sstevel@tonic-gate extern	void	*my_calloc(size_t, size_t, const char *);
537c478bd9Sstevel@tonic-gate extern	void	make_pname(private_t *, id_t);
547c478bd9Sstevel@tonic-gate extern	int	requested(private_t *, int, int);
557c478bd9Sstevel@tonic-gate extern	int	jobcontrol(private_t *, int);
567c478bd9Sstevel@tonic-gate extern	int	signalled(private_t *, int, int);
577c478bd9Sstevel@tonic-gate extern	int	faulted(private_t *, int);
587c478bd9Sstevel@tonic-gate extern	int	sysentry(private_t *, int);
597c478bd9Sstevel@tonic-gate extern	int	sysexit(private_t *, int);
607c478bd9Sstevel@tonic-gate extern	void	showbuffer(private_t *, long, long);
617c478bd9Sstevel@tonic-gate extern	void	showbytes(const char *, int, char *);
627c478bd9Sstevel@tonic-gate extern	void	accumulate(timestruc_t *,
637c478bd9Sstevel@tonic-gate 			const timestruc_t *, const timestruc_t *);
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate extern	const char *ioctlname(private_t *, uint_t);
667c478bd9Sstevel@tonic-gate extern	const char *ioctldatastruct(uint_t);
677c478bd9Sstevel@tonic-gate extern	const char *fcntlname(int);
687c478bd9Sstevel@tonic-gate extern	const char *sfsname(int);
697c478bd9Sstevel@tonic-gate extern	const char *plockname(int);
707c478bd9Sstevel@tonic-gate extern	const char *si86name(int);
717c478bd9Sstevel@tonic-gate extern	const char *utscode(int);
727c478bd9Sstevel@tonic-gate extern	const char *openarg(private_t *, int);
737c478bd9Sstevel@tonic-gate extern	const char *whencearg(int);
747c478bd9Sstevel@tonic-gate extern	const char *msgflags(private_t *, int);
757c478bd9Sstevel@tonic-gate extern	const char *semflags(private_t *, int);
767c478bd9Sstevel@tonic-gate extern	const char *shmflags(private_t *, int);
777c478bd9Sstevel@tonic-gate extern	const char *msgcmd(int);
787c478bd9Sstevel@tonic-gate extern	const char *semcmd(int);
797c478bd9Sstevel@tonic-gate extern	const char *shmcmd(int);
807c478bd9Sstevel@tonic-gate extern	const char *strrdopt(int);
817c478bd9Sstevel@tonic-gate extern	const char *strevents(private_t *, int);
827c478bd9Sstevel@tonic-gate extern	const char *tiocflush(private_t *, int);
837c478bd9Sstevel@tonic-gate extern	const char *strflush(int);
847c478bd9Sstevel@tonic-gate extern	const char *mountflags(private_t *, int);
857c478bd9Sstevel@tonic-gate extern	const char *svfsflags(private_t *, ulong_t);
867c478bd9Sstevel@tonic-gate extern	const char *sconfname(int);
877c478bd9Sstevel@tonic-gate extern	const char *pathconfname(int);
887c478bd9Sstevel@tonic-gate extern	const char *fuiname(int);
897c478bd9Sstevel@tonic-gate extern	const char *fuflags(private_t *, int);
907c478bd9Sstevel@tonic-gate extern	const char *ipprotos(int);
91aa4a4f3bSnf202958 extern	const char *rctlsyscode(int);
92aa4a4f3bSnf202958 extern	const char *rctl_local_flags(private_t *, uint_t val);
93aa4a4f3bSnf202958 extern	const char *rctl_local_action(private_t *, uint_t val);
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate extern	void	expound(private_t *, long, int);
967c478bd9Sstevel@tonic-gate extern	void	prtimestruc(private_t *, const char *, timestruc_t *);
977c478bd9Sstevel@tonic-gate extern	void	print_siginfo(private_t *, const siginfo_t *);
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate extern	void	Flush(void);
1007c478bd9Sstevel@tonic-gate extern	void	Eserialize(void);
1017c478bd9Sstevel@tonic-gate extern	void	Xserialize(void);
1027c478bd9Sstevel@tonic-gate extern	void	procadd(pid_t, const char *lwplist);
1037c478bd9Sstevel@tonic-gate extern	int	lwptrace(pid_t, lwpid_t);
1047c478bd9Sstevel@tonic-gate extern	void	procdel(void);
1057c478bd9Sstevel@tonic-gate extern	int	checkproc(private_t *);
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate extern	int	syslist(char *, sysset_t *, int *);
1087c478bd9Sstevel@tonic-gate extern	int	siglist(private_t *, char *, sigset_t *, int *);
1097c478bd9Sstevel@tonic-gate extern	int	fltlist(char *, fltset_t *, int *);
1107c478bd9Sstevel@tonic-gate extern	int	fdlist(char *, fileset_t *);
1117c478bd9Sstevel@tonic-gate extern	int	liblist(char *, int);
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate extern	char 	*fetchstring(private_t *, long, int);
1147c478bd9Sstevel@tonic-gate extern	void	show_cred(private_t *, int);
1157c478bd9Sstevel@tonic-gate extern	void	errmsg(const char *, const char *);
1167c478bd9Sstevel@tonic-gate extern	void	abend(const char *, const char *);
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate extern	void	outstring(private_t *, const char *);
1197c478bd9Sstevel@tonic-gate extern	void	grow(private_t *, int);
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate extern	void	show_procset(private_t *, long);
1227c478bd9Sstevel@tonic-gate extern	const char *idtype_enum(private_t *, long);
1237c478bd9Sstevel@tonic-gate extern	const char *woptions(private_t *, int);
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate extern	void	putpname(private_t *);
1267c478bd9Sstevel@tonic-gate extern	void	timestamp(private_t *);
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate extern	const char *errname(int);
1297c478bd9Sstevel@tonic-gate extern	const char *sysname(private_t *, int, int);
1307c478bd9Sstevel@tonic-gate extern	const char *rawsigname(private_t *, int);
1317c478bd9Sstevel@tonic-gate extern	const char *signame(private_t *, int);
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate extern	int	getsubcode(private_t *);
1347c478bd9Sstevel@tonic-gate extern	int	maxsyscalls(void);
1357c478bd9Sstevel@tonic-gate extern	int	nsubcodes(int);
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate extern	void	show_stat(private_t *, long);
1387c478bd9Sstevel@tonic-gate extern	void	show_statat(private_t *, long);
1397c478bd9Sstevel@tonic-gate extern	void	show_xstat(private_t *, int, long);
1407c478bd9Sstevel@tonic-gate extern	void	show_stat64_32(private_t *, long);
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate extern	void	establish_breakpoints(void);
1437c478bd9Sstevel@tonic-gate extern	void	establish_stacks(void);
1447c478bd9Sstevel@tonic-gate extern	void	reset_breakpoints(void);
1457c478bd9Sstevel@tonic-gate extern	void	clear_breakpoints(void);
1467c478bd9Sstevel@tonic-gate extern	int	function_trace(private_t *, int, int, int);
1477c478bd9Sstevel@tonic-gate extern	void	reestablish_traps(void);
1487c478bd9Sstevel@tonic-gate extern	void	report_htable_stats(void);
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate extern	const char *door_flags(private_t *, long);
1517c478bd9Sstevel@tonic-gate extern	void	prt_ffg(private_t *, int, long);
1527c478bd9Sstevel@tonic-gate extern	void	escape_string(private_t *, const char *);
1537c478bd9Sstevel@tonic-gate 
1547c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1557c478bd9Sstevel@tonic-gate }
1567c478bd9Sstevel@tonic-gate #endif
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #endif	/* _PROTO_H */
159