summaryrefslogtreecommitdiffstats
path: root/common/.svn/text-base/compat.c.svn-base
blob: 98fb1a118512738a745bf60dcbf4d312b646e2b5 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "compat.h"

#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>

RCSID("$Id: compat.c,v 1.1 2000/03/07 22:39:27 shmit Exp $");

#if NEED_SETPROCTITLE
void
setproctitle(const char *fmt, ...)
{
}
#endif

#if NEED_SNPRINTF
int
snprintf(char *str, size_t size, const char *fmt, ...)
{
	va_list ap;
	int rc;

	va_start(ap, fmt);
	rc = vsprintf(str, fmt, ap);
	va_end(ap);

	return rc;
}
#endif

#if NEED_MEMCPY
void *
memcpy(void *dst, const void *src, size_t len)
{
	size_t i;

	for (i = 0; i < len; i++)
		(char *)dst+i = (char *)src+i;

	return dst;
}
#endif

#if NEED_MEMSET
void *
memset(void *dst, char c, size_t len)
{
	size_t i;

	for (i = 0; i < len; i++)
		(char *)dst+i = (char *)src+i;

	return dst;
}
#endif