xref: /onnv-gate/usr/src/cmd/truss/proto.h (revision 10927:ac35db8a7412)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52447Snf202958  * Common Development and Distribution License (the "License").
62447Snf202958  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*10927SRoger.Faulkner@Sun.COM 
220Sstevel@tonic-gate /*
23*10927SRoger.Faulkner@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
280Sstevel@tonic-gate /*	  All Rights Reserved  	*/
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifndef	_PROTO_H
310Sstevel@tonic-gate #define	_PROTO_H
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/procset.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /* avoid a bit of stdio locking */
400Sstevel@tonic-gate #define	fputc	putc_unlocked
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /* force (via setvbuf()) a reasonably large output file buffer size */
430Sstevel@tonic-gate #define	MYBUFSIZ	8192
440Sstevel@tonic-gate 
450Sstevel@tonic-gate /*
460Sstevel@tonic-gate  * Function prototypes for most external functions.
470Sstevel@tonic-gate  */
480Sstevel@tonic-gate 
490Sstevel@tonic-gate extern	private_t *get_private(void);
500Sstevel@tonic-gate extern	void	*my_malloc(size_t, const char *);
510Sstevel@tonic-gate extern	void	*my_realloc(void *, size_t, const char *);
520Sstevel@tonic-gate extern	void	*my_calloc(size_t, size_t, const char *);
530Sstevel@tonic-gate extern	void	make_pname(private_t *, id_t);
540Sstevel@tonic-gate extern	int	requested(private_t *, int, int);
550Sstevel@tonic-gate extern	int	jobcontrol(private_t *, int);
560Sstevel@tonic-gate extern	int	signalled(private_t *, int, int);
570Sstevel@tonic-gate extern	int	faulted(private_t *, int);
580Sstevel@tonic-gate extern	int	sysentry(private_t *, int);
590Sstevel@tonic-gate extern	int	sysexit(private_t *, int);
600Sstevel@tonic-gate extern	void	showbuffer(private_t *, long, long);
610Sstevel@tonic-gate extern	void	showbytes(const char *, int, char *);
620Sstevel@tonic-gate extern	void	accumulate(timestruc_t *,
630Sstevel@tonic-gate 			const timestruc_t *, const timestruc_t *);
640Sstevel@tonic-gate 
650Sstevel@tonic-gate extern	const char *ioctlname(private_t *, uint_t);
660Sstevel@tonic-gate extern	const char *ioctldatastruct(uint_t);
670Sstevel@tonic-gate extern	const char *fcntlname(int);
680Sstevel@tonic-gate extern	const char *sfsname(int);
690Sstevel@tonic-gate extern	const char *plockname(int);
700Sstevel@tonic-gate extern	const char *si86name(int);
710Sstevel@tonic-gate extern	const char *utscode(int);
720Sstevel@tonic-gate extern	const char *openarg(private_t *, int);
730Sstevel@tonic-gate extern	const char *whencearg(int);
740Sstevel@tonic-gate extern	const char *msgflags(private_t *, int);
750Sstevel@tonic-gate extern	const char *semflags(private_t *, int);
760Sstevel@tonic-gate extern	const char *shmflags(private_t *, int);
770Sstevel@tonic-gate extern	const char *msgcmd(int);
780Sstevel@tonic-gate extern	const char *semcmd(int);
790Sstevel@tonic-gate extern	const char *shmcmd(int);
800Sstevel@tonic-gate extern	const char *strrdopt(int);
810Sstevel@tonic-gate extern	const char *strevents(private_t *, int);
820Sstevel@tonic-gate extern	const char *tiocflush(private_t *, int);
830Sstevel@tonic-gate extern	const char *strflush(int);
840Sstevel@tonic-gate extern	const char *mountflags(private_t *, int);
850Sstevel@tonic-gate extern	const char *svfsflags(private_t *, ulong_t);
860Sstevel@tonic-gate extern	const char *sconfname(int);
870Sstevel@tonic-gate extern	const char *pathconfname(int);
880Sstevel@tonic-gate extern	const char *fuiname(int);
890Sstevel@tonic-gate extern	const char *fuflags(private_t *, int);
900Sstevel@tonic-gate extern	const char *ipprotos(int);
912447Snf202958 extern	const char *rctlsyscode(int);
922447Snf202958 extern	const char *rctl_local_flags(private_t *, uint_t val);
932447Snf202958 extern	const char *rctl_local_action(private_t *, uint_t val);
940Sstevel@tonic-gate 
950Sstevel@tonic-gate extern	void	expound(private_t *, long, int);
960Sstevel@tonic-gate extern	void	prtimestruc(private_t *, const char *, timestruc_t *);
970Sstevel@tonic-gate extern	void	print_siginfo(private_t *, const siginfo_t *);
980Sstevel@tonic-gate 
990Sstevel@tonic-gate extern	void	Flush(void);
1000Sstevel@tonic-gate extern	void	Eserialize(void);
1010Sstevel@tonic-gate extern	void	Xserialize(void);
1020Sstevel@tonic-gate extern	void	procadd(pid_t, const char *lwplist);
1030Sstevel@tonic-gate extern	int	lwptrace(pid_t, lwpid_t);
1040Sstevel@tonic-gate extern	void	procdel(void);
1050Sstevel@tonic-gate extern	int	checkproc(private_t *);
1060Sstevel@tonic-gate 
1070Sstevel@tonic-gate extern	int	syslist(char *, sysset_t *, int *);
1080Sstevel@tonic-gate extern	int	siglist(private_t *, char *, sigset_t *, int *);
1090Sstevel@tonic-gate extern	int	fltlist(char *, fltset_t *, int *);
1100Sstevel@tonic-gate extern	int	fdlist(char *, fileset_t *);
1110Sstevel@tonic-gate extern	int	liblist(char *, int);
1120Sstevel@tonic-gate 
1130Sstevel@tonic-gate extern	char 	*fetchstring(private_t *, long, int);
1140Sstevel@tonic-gate extern	void	show_cred(private_t *, int);
1150Sstevel@tonic-gate extern	void	errmsg(const char *, const char *);
1160Sstevel@tonic-gate extern	void	abend(const char *, const char *);
1170Sstevel@tonic-gate 
1180Sstevel@tonic-gate extern	void	outstring(private_t *, const char *);
1190Sstevel@tonic-gate extern	void	grow(private_t *, int);
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate extern	void	show_procset(private_t *, long);
1220Sstevel@tonic-gate extern	const char *idtype_enum(private_t *, long);
1230Sstevel@tonic-gate extern	const char *woptions(private_t *, int);
1240Sstevel@tonic-gate 
1250Sstevel@tonic-gate extern	void	putpname(private_t *);
1260Sstevel@tonic-gate extern	void	timestamp(private_t *);
1270Sstevel@tonic-gate 
1280Sstevel@tonic-gate extern	const char *errname(int);
1290Sstevel@tonic-gate extern	const char *sysname(private_t *, int, int);
1300Sstevel@tonic-gate extern	const char *rawsigname(private_t *, int);
1310Sstevel@tonic-gate extern	const char *signame(private_t *, int);
1320Sstevel@tonic-gate 
1330Sstevel@tonic-gate extern	int	getsubcode(private_t *);
1340Sstevel@tonic-gate extern	int	maxsyscalls(void);
1350Sstevel@tonic-gate extern	int	nsubcodes(int);
1360Sstevel@tonic-gate 
1370Sstevel@tonic-gate extern	void	show_stat(private_t *, long);
1380Sstevel@tonic-gate extern	void	show_statat(private_t *, long);
1390Sstevel@tonic-gate extern	void	show_xstat(private_t *, int, long);
1400Sstevel@tonic-gate extern	void	show_stat64_32(private_t *, long);
1410Sstevel@tonic-gate 
1420Sstevel@tonic-gate extern	void	establish_breakpoints(void);
1430Sstevel@tonic-gate extern	void	establish_stacks(void);
1440Sstevel@tonic-gate extern	void	reset_breakpoints(void);
1450Sstevel@tonic-gate extern	void	clear_breakpoints(void);
1460Sstevel@tonic-gate extern	int	function_trace(private_t *, int, int, int);
1470Sstevel@tonic-gate extern	void	reestablish_traps(void);
1480Sstevel@tonic-gate extern	void	report_htable_stats(void);
1490Sstevel@tonic-gate 
1500Sstevel@tonic-gate extern	const char *door_flags(private_t *, long);
1510Sstevel@tonic-gate extern	void	prt_ffg(private_t *, int, long);
1520Sstevel@tonic-gate extern	void	escape_string(private_t *, const char *);
1530Sstevel@tonic-gate 
1540Sstevel@tonic-gate #ifdef	__cplusplus
1550Sstevel@tonic-gate }
1560Sstevel@tonic-gate #endif
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate #endif	/* _PROTO_H */
159