xref: /illumos-gate/usr/src/cmd/truss/proto.h (revision 134a1f4e)
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
5aa4a4f3bSnf  * Common Development and Distribution License (the "License").
6aa4a4f3bSnf  * 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  */
215403172aSRoger A. Faulkner 
227c478bd9Sstevel@tonic-gate /*
23*134a1f4eSCasper H.S. Dik  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
277c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_PROTO_H
307c478bd9Sstevel@tonic-gate #define	_PROTO_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/procset.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /* avoid a bit of stdio locking */
397c478bd9Sstevel@tonic-gate #define	fputc	putc_unlocked
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /* force (via setvbuf()) a reasonably large output file buffer size */
427c478bd9Sstevel@tonic-gate #define	MYBUFSIZ	8192
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * Function prototypes for most external functions.
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate extern	private_t *get_private(void);
497c478bd9Sstevel@tonic-gate extern	void	*my_malloc(size_t, const char *);
507c478bd9Sstevel@tonic-gate extern	void	*my_realloc(void *, size_t, const char *);
517c478bd9Sstevel@tonic-gate extern	void	*my_calloc(size_t, size_t, const char *);
527c478bd9Sstevel@tonic-gate extern	void	make_pname(private_t *, id_t);
537c478bd9Sstevel@tonic-gate extern	int	requested(private_t *, int, int);
547c478bd9Sstevel@tonic-gate extern	int	jobcontrol(private_t *, int);
557c478bd9Sstevel@tonic-gate extern	int	signalled(private_t *, int, int);
567c478bd9Sstevel@tonic-gate extern	int	faulted(private_t *, int);
577c478bd9Sstevel@tonic-gate extern	int	sysentry(private_t *, int);
587c478bd9Sstevel@tonic-gate extern	int	sysexit(private_t *, int);
597c478bd9Sstevel@tonic-gate extern	void	showbuffer(private_t *, long, long);
607c478bd9Sstevel@tonic-gate extern	void	showbytes(const char *, int, char *);
617c478bd9Sstevel@tonic-gate extern	void	accumulate(timestruc_t *,
627c478bd9Sstevel@tonic-gate 			const timestruc_t *, const timestruc_t *);
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate extern	const char *ioctlname(private_t *, uint_t);
657c478bd9Sstevel@tonic-gate extern	const char *ioctldatastruct(uint_t);
667c478bd9Sstevel@tonic-gate extern	const char *fcntlname(int);
677c478bd9Sstevel@tonic-gate extern	const char *sfsname(int);
687c478bd9Sstevel@tonic-gate extern	const char *si86name(int);
697c478bd9Sstevel@tonic-gate extern	const char *utscode(int);
707c478bd9Sstevel@tonic-gate extern	const char *openarg(private_t *, int);
717c478bd9Sstevel@tonic-gate extern	const char *whencearg(int);
727c478bd9Sstevel@tonic-gate extern	const char *msgflags(private_t *, int);
737c478bd9Sstevel@tonic-gate extern	const char *semflags(private_t *, int);
747c478bd9Sstevel@tonic-gate extern	const char *shmflags(private_t *, int);
757c478bd9Sstevel@tonic-gate extern	const char *msgcmd(int);
767c478bd9Sstevel@tonic-gate extern	const char *semcmd(int);
777c478bd9Sstevel@tonic-gate extern	const char *shmcmd(int);
787c478bd9Sstevel@tonic-gate extern	const char *strrdopt(int);
797c478bd9Sstevel@tonic-gate extern	const char *strevents(private_t *, int);
807c478bd9Sstevel@tonic-gate extern	const char *tiocflush(private_t *, int);
817c478bd9Sstevel@tonic-gate extern	const char *strflush(int);
827c478bd9Sstevel@tonic-gate extern	const char *mountflags(private_t *, int);
837c478bd9Sstevel@tonic-gate extern	const char *svfsflags(private_t *, ulong_t);
847c478bd9Sstevel@tonic-gate extern	const char *sconfname(int);
857c478bd9Sstevel@tonic-gate extern	const char *pathconfname(int);
867c478bd9Sstevel@tonic-gate extern	const char *fuiname(int);
877c478bd9Sstevel@tonic-gate extern	const char *fuflags(private_t *, int);
887c478bd9Sstevel@tonic-gate extern	const char *ipprotos(int);
89aa4a4f3bSnf extern	const char *rctlsyscode(int);
90aa4a4f3bSnf extern	const char *rctl_local_flags(private_t *, uint_t val);
91aa4a4f3bSnf extern	const char *rctl_local_action(private_t *, uint_t val);
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate extern	void	expound(private_t *, long, int);
947c478bd9Sstevel@tonic-gate extern	void	prtimestruc(private_t *, const char *, timestruc_t *);
957c478bd9Sstevel@tonic-gate extern	void	print_siginfo(private_t *, const siginfo_t *);
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate extern	void	Flush(void);
987c478bd9Sstevel@tonic-gate extern	void	Eserialize(void);
997c478bd9Sstevel@tonic-gate extern	void	Xserialize(void);
1007c478bd9Sstevel@tonic-gate extern	void	procadd(pid_t, const char *lwplist);
1017c478bd9Sstevel@tonic-gate extern	int	lwptrace(pid_t, lwpid_t);
1027c478bd9Sstevel@tonic-gate extern	void	procdel(void);
1037c478bd9Sstevel@tonic-gate extern	int	checkproc(private_t *);
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate extern	int	syslist(char *, sysset_t *, int *);
1067c478bd9Sstevel@tonic-gate extern	int	siglist(private_t *, char *, sigset_t *, int *);
1077c478bd9Sstevel@tonic-gate extern	int	fltlist(char *, fltset_t *, int *);
1087c478bd9Sstevel@tonic-gate extern	int	fdlist(char *, fileset_t *);
1097c478bd9Sstevel@tonic-gate extern	int	liblist(char *, int);
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate extern	char 	*fetchstring(private_t *, long, int);
112*134a1f4eSCasper H.S. Dik extern	void	show_cred(private_t *, int, int);
1137c478bd9Sstevel@tonic-gate extern	void	errmsg(const char *, const char *);
1147c478bd9Sstevel@tonic-gate extern	void	abend(const char *, const char *);
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate extern	void	outstring(private_t *, const char *);
1177c478bd9Sstevel@tonic-gate extern	void	grow(private_t *, int);
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate extern	void	show_procset(private_t *, long);
1207c478bd9Sstevel@tonic-gate extern	const char *idtype_enum(private_t *, long);
1217c478bd9Sstevel@tonic-gate extern	const char *woptions(private_t *, int);
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate extern	void	putpname(private_t *);
1247c478bd9Sstevel@tonic-gate extern	void	timestamp(private_t *);
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate extern	const char *errname(int);
1277c478bd9Sstevel@tonic-gate extern	const char *sysname(private_t *, int, int);
1287c478bd9Sstevel@tonic-gate extern	const char *rawsigname(private_t *, int);
1297c478bd9Sstevel@tonic-gate extern	const char *signame(private_t *, int);
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate extern	int	getsubcode(private_t *);
1327c478bd9Sstevel@tonic-gate extern	int	maxsyscalls(void);
1337c478bd9Sstevel@tonic-gate extern	int	nsubcodes(int);
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate extern	void	show_stat(private_t *, long);
1367c478bd9Sstevel@tonic-gate extern	void	show_stat64_32(private_t *, long);
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate extern	void	establish_breakpoints(void);
1397c478bd9Sstevel@tonic-gate extern	void	establish_stacks(void);
1407c478bd9Sstevel@tonic-gate extern	void	reset_breakpoints(void);
1417c478bd9Sstevel@tonic-gate extern	void	clear_breakpoints(void);
1427c478bd9Sstevel@tonic-gate extern	int	function_trace(private_t *, int, int, int);
1437c478bd9Sstevel@tonic-gate extern	void	reestablish_traps(void);
1447c478bd9Sstevel@tonic-gate extern	void	report_htable_stats(void);
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate extern	const char *door_flags(private_t *, long);
1477c478bd9Sstevel@tonic-gate extern	void	prt_ffg(private_t *, int, long);
1487c478bd9Sstevel@tonic-gate extern	void	escape_string(private_t *, const char *);
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1517c478bd9Sstevel@tonic-gate }
1527c478bd9Sstevel@tonic-gate #endif
1537c478bd9Sstevel@tonic-gate 
1547c478bd9Sstevel@tonic-gate #endif	/* _PROTO_H */
155