xref: /illumos-gate/usr/src/cmd/fs.d/autofs/debug_alloc.h (revision 533affcbc7fc4d0c8132976ea454aaa715fe2307)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1998,2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_MY_ALLOC_H
28 #define	_MY_ALLOC_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <netdb.h>
35 #include <netdir.h>
36 #include <rpc/nettype.h>
37 
38 int add_alloc(char *, void *, size_t, const char *, int);
39 int drop_alloc(const char *, void *, const char *, int);
40 
41 void *my_malloc(size_t, const char *, int);
42 void *my_realloc(void *, size_t, const char *, int);
43 void my_free(void *, const char *, int);
44 char *my_strdup(const char *, const char *, int);
45 
46 int  my_sethostent(int, const char *, int);
47 int  my_endhostent(const char *, int);
48 
49 void *my_setnetconfig(const char *, int);
50 int  my_endnetconfig(void *, const char *, int);
51 
52 void *my_setnetpath(const char *, int);
53 int  my_endnetpath(void *, const char *, int);
54 
55 int  my_netdir_getbyname(struct netconfig *, struct nd_hostserv *,
56 	struct nd_addrlist **, const char *, int);
57 int  my_netdir_free(void *, int, const char *, int);
58 
59 struct hostent *my_getipnodebyname(const char *, int, int, int *, char *, int);
60 void my_freehostent(struct hostent *, char *, int);
61 
62 struct netconfig *my_getnetconfigent(char *, char *, int);
63 void  my_freenetconfigent(struct netconfig *, char *, int);
64 
65 void *my__rpc_setconf(char *, char *, int);
66 void my__rpc_endconf(void *, char *, int);
67 
68 void check_leaks(char *);
69 
70 #define	AUTOFS_DUMP_DEBUG	1000000
71 #define	free(a)			my_free(a, __FILE__, __LINE__)
72 #define	malloc(a)		my_malloc(a, __FILE__, __LINE__)
73 #define	realloc(a, s)		my_realloc(a, s, __FILE__, __LINE__)
74 #define	strdup(a)		my_strdup(a, __FILE__, __LINE__)
75 
76 #define	sethostent(s)		my_sethostent(s, __FILE__, __LINE__)
77 #define	endhostent()		my_endhostent(__FILE__, __LINE__)
78 
79 #define	setnetconfig()		my_setnetconfig(__FILE__, __LINE__)
80 #define	endnetconfig(v)		my_endnetconfig(v, __FILE__, __LINE__)
81 
82 #define	setnetpath()		my_setnetpath(__FILE__, __LINE__)
83 #define	endnetpath(v)		my_endnetpath(v, __FILE__, __LINE__)
84 
85 #define	netdir_getbyname(t, s, a)	\
86 	my_netdir_getbyname(t, s, a, __FILE__, __LINE__)
87 #define	netdir_free(a, t)	my_netdir_free(a, t, __FILE__, __LINE__)
88 
89 #define	getipnodebyname(n, a, f, e)	\
90 	my_getipnodebyname(n, a, f, e, __FILE__, __LINE__)
91 #define	 freehostent(h)		my_freehostent(h, __FILE__, __LINE__)
92 
93 #define	getnetconfigent(n)	my_getnetconfigent(n, __FILE__, __LINE__)
94 #define	freenetconfigent(n)	my_freenetconfigent(n, __FILE__, __LINE__)
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif	/* _MY_ALLOC_H */
101