File: realloc.c

package info (click to toggle)
lsb-appchk3 3.2.2-1.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 157,336 kB
  • ctags: 17,415
  • sloc: ansic: 528,541; cpp: 5,641; perl: 3,051; makefile: 801; xml: 702; python: 302; sh: 205; awk: 42
file content (33 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Maintained by hand (Matt Elder, Stuart Anderson)

#include "../../tests/type_tests.h"
#include "../../misc/lsb_output.h"
#include <dlfcn.h>
#include <stddef.h>
#undef realloc
static void *(*funcptr)(void *, size_t) = 0;

void * __libc_realloc(void *, size_t);
extern int __lsb_check_params;

void * realloc(void * arg0, size_t arg1)
{
	int reset_flag = __lsb_check_params;
	void * ret_value;

	if(!funcptr)
		funcptr = __libc_realloc;
	if(__lsb_check_params)
	{
		__lsb_check_params=0;	
        	__lsb_output(5-reset_flag, "realloc()");
		validate_NULL_TYPETYPE(arg0, "realloc");
		validate_NULL_TYPETYPE(arg1, "realloc");
	}
	
	ret_value = funcptr(arg0, arg1);
	__lsb_check_params = reset_flag;
	return ret_value;
}