From 45a20ab721a513710138340faff3d59a31c3e01e Mon Sep 17 00:00:00 2001 From: forsyth Date: Mon, 3 Jun 2013 21:01:14 +0000 Subject: sync compilers with Plan 9 remove 1[acl] 2[acl] --- utils/vl/compat.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'utils/vl/compat.c') diff --git a/utils/vl/compat.c b/utils/vl/compat.c index 5e676913..fa93a42a 100644 --- a/utils/vl/compat.c +++ b/utils/vl/compat.c @@ -4,7 +4,7 @@ * fake malloc */ void* -malloc(long n) +malloc(ulong n) { void *p; @@ -25,7 +25,7 @@ free(void *p) } void* -calloc(long m, long n) +calloc(ulong m, ulong n) { void *p; @@ -36,9 +36,9 @@ calloc(long m, long n) } void* -realloc(void *p, long n) +realloc(void*, ulong) { - fprint(2, "realloc called\n", p, n); + fprint(2, "realloc called\n"); abort(); return 0; } @@ -48,3 +48,18 @@ mysbrk(ulong size) { return sbrk(size); } + +void +setmalloctag(void *v, ulong pc) +{ + USED(v, pc); +} + +int +fileexists(char *s) +{ + uchar dirbuf[400]; + + /* it's fine if stat result doesn't fit in dirbuf, since even then the file exists */ + return stat(s, dirbuf, sizeof(dirbuf)) >= 0; +} -- cgit v1.2.3